ChangeLog.tree-ssa 743 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346
  1. 2004-05-11 Diego Novillo <dnovillo@redhat.com>
  2. * tree-cfg.c (delete_tree_cfg): Update call to
  3. free_basic_block_vars.
  4. 2004-05-10 Diego Novillo <dnovillo@redhat.com>
  5. * tree-ssa-live.h: Fix typo in #include guard.
  6. 2004-05-08 Jeff Sturm <jsturm@one-point.com>
  7. * tree-eh.c (lower_catch): Lower catch body in context of
  8. catch_region.
  9. 2004-05-07 Richard Henderson <rth@redhat.com>
  10. * tree-eh.c (tree_could_trap_p): Use get_base_address on references.
  11. 2004-05-07 Diego Novillo <dnovillo@redhat.com>
  12. * doc/invoke.texi: Remove documentation for -ftree-copyprop.
  13. Update documentation for -ftree-pre.
  14. 2004-05-06 Richard Henderson <rth@redhat.com>
  15. * stmt.c (parse_output_constraint): Don't warn for read-write
  16. memory operand.
  17. * gimplify.c (gimplify_asm_expr): Force in-out memory operands
  18. to minimal lvalues, then expand to non-matching constraints.
  19. 2004-05-06 Zack Weinberg <zack@codesourcery.com>
  20. * c-decl.c (finish_function): When !targetm.have_ctors_dtors,
  21. record static constructors and destructors here...
  22. (c_expand_body_1): ... not here.
  23. * c-objc-common.c (start_cdtor, finish_cdtor): Collapse
  24. together into
  25. (build_cdtor): ...here. Update to construct a complete tree
  26. for the function. No need to call push_scope, pop_scope, or
  27. clear_last_expr, or set current_function_cannot_inline.
  28. (c_objc_common_finish_file): Just call build_cdtor for static
  29. ctors/dtors, then clear the variables. Do this before calling
  30. cgraph_finalize_compilation_unit and cgraph_optimize.
  31. 2004-05-06 Richard Henderson <rth@redhat.com>
  32. * fold-const.c (fold): Don't build COND_EXPR from comparisons for
  33. boolean and integer result types. Handle X ^ X for TRUTH_XOR_EXPR.
  34. 2004-05-05 Richard Henderson <rth@redhat.com>
  35. * tree-nested.c (create_tmp_var_for): Disallow variable sized types.
  36. (convert_nonlocal_reference): Set val_only false for the base of a
  37. component or array reference.
  38. (convert_local_reference): Likewise.
  39. 2004-05-05 Richard Henderson <rth@redhat.com>
  40. * gimplify.c (create_tmp_var): Disallow variable sized objects.
  41. (gimplify_modify_expr): Don't memcpy for VA_ARG_EXPR.
  42. 2004-05-05 Richard Henderson <rth@redhat.com>
  43. * fold-const.c (operand_equal_p): Replace only_const argument with
  44. flags. Allow pure functions if OEP_PURE_SAME.
  45. (fold, nondestructive_fold_binary_to_constant): Use OEP_ONLY_CONST.
  46. * tree-cfg.c (phi_alternatives_equal): Fix operand_equal_p flag type.
  47. * tree-ssa-dom.c (avail_expr_eq): Use OEP_PURE_SAME.
  48. * tree.h (enum operand_equal_flag): New.
  49. (operand_equal_p): Update argument list.
  50. 2004-05-05 Richard Henderson <rth@redhat.com>
  51. * tree-ssa-operands.c (get_call_flags): Remove.
  52. (get_expr_operands): Use call_expr_flags.
  53. * tree-alias-common.c (call_may_clobber): Likewise.
  54. (call_may_return): Likewise.
  55. 2004-04-05 Andrew Pinski <pinskia@physics.uc.edu>
  56. PR c/15062
  57. * c-typeck.c (build_asm_expr): Mark the output operands
  58. to an asm addressable, if necessary.
  59. 2004-05-05 Steven Bosscher <stevenb@suse.de>
  60. * Makefile.in (GTFILES): Remove duplicate basic-block.h.
  61. 2004-05-04 Richard Henderson <rth@redhat.com>
  62. * gimplify.c (build_addr_expr_with_type): Set TREE_ADDRESSABLE.
  63. (gimplify_modify_expr): Turn variable-width assignment into memcpy.
  64. * tree-nested.c (convert_local_reference): Set val_only after default.
  65. 2004-05-04 Diego Novillo <dnovillo@redhat.com>
  66. * tree-cfg.c (tree_cfg2vcg): Rename from tree_cfg2dot. Update all
  67. users.
  68. Emit flowgraph using VCG syntax.
  69. * tree-dump.c (dump_files): Rename -fdump-tree-dot to
  70. -fdump-tree-vcg.
  71. * tree.h (enum tree_dump_index): Rename TDI_dot to TDI_vcg.
  72. * doc/invoke.texi: Update documentation to describe
  73. -fdump-tree-vcg.
  74. 2004-05-03 Andrew Pinski <pinskia@physics.uc.edu>
  75. * objc/objc-act.c (build_objc_string_object):
  76. Add the fields to the purpose of the list for
  77. the constructor.
  78. 2004-05-03 Richard Henderson <rth@redhat.com>
  79. * c-simplify.c (gimplify_if_stmt): Loop for else-if.
  80. 2004-05-03 Andrew Pinski <pinskia@physics.uc.edu>
  81. PR optimization/15245
  82. * tree-ssa-phiopt.c (conditional_replacement): Use fold_convert
  83. instead of convert.
  84. 2004-05-03 Diego Novillo <dnovillo@redhat.com>
  85. * gimplify.c (gimplify_compound_lval): Gimplify non-constant
  86. array indices into a temporary variable.
  87. 2004-04-30 Richard Henderson <rth@redhat.com>
  88. * builtins.c (validate_arglist): Don't reject side effects.
  89. (simplify_builtin_strcpy): Do reject side effects in length.
  90. 2004-04-30 Jeff Law <law@redhat.com>
  91. * tree-outof-ssa.c (eliminate_build): Move code which verifies
  92. that all of a PHI's arguments do not have a partition if the
  93. result does not have a partition from here to...
  94. (rewrite_trees): Here.
  95. 2004-04-24 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  96. * tree-cfg.c (factored_computed_goto_label,
  97. factored_computed_goto): Removed.
  98. (disband_implicit_edges): Unfactor computed gotos without
  99. using them.
  100. 2004-04-23 Per Bothner <per@bothner.com>
  101. * expr.c (expr_wfl_stack): Remove unused global.
  102. Pre-patches for future source_location / location_t merge.
  103. * tree.h (EXPR_LOCATION, EXPR_HAS_LOCATION): New macros.
  104. * expr.c (expand_expr_real, expand_expr_real_1): Use new macros.
  105. * gimple-low.c (lower_stmt): Likewise.
  106. * gimplify.c (annotate_all_with_locus): Likewise.
  107. * print-tree.c (print_node): Likewise.
  108. * tree-inline.c (expand_call_inline): Likewise.
  109. * tree-pretty-print.c (tree-pretty-print.c): Likewise.
  110. * tree-sra.c (scalarize_structure_assignment, emit_scalar_copies,
  111. scalarize_call_expr): Likewise.
  112. * tree-ssa-pre.c (code_motion): Likewise.
  113. 2004-04-23 Andrew Pinski <pinskia@physics.uc.edu>
  114. * c-simplify.c (gimplify_decl_stmt) [TYPE_DECL]:
  115. Do not check the type.
  116. 2004-04-22 Jeff Law <law@redhat.com>
  117. * tree-into-ssa.c (rewrite_initialize_block_local_data): Mark all
  118. arguments as potentially unused. Do not bother to VARRAY_CLEAR
  119. the block_defs. Instead abort if we are presented with a block
  120. which has a nonempty block_defs. Wrap entire thing inside
  121. #ifdef ENABLE_CHECKING.
  122. * tree-ssa-dom.c (dom_opt_initialize_block_local_data): Similarly
  123. * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Do not mark
  124. arguments to bypassed PHIs as needing to be rewritten.
  125. 2004-04-21 Richard Henderson <rth@redhat.com>
  126. PR middle-end/14978
  127. * tree-nested.c (convert_nonlocal_reference): Set val_only when
  128. processing any otherwise unhandled expression.
  129. 2004-04-21 Jeff Law <law@redhat.com>
  130. * tree-ssa-copy.c (cprop_operand): Break out of cprop_into_stmt.
  131. (cprop_into_stmt): Use cprop_operand. Rearrange slightly to avoid
  132. switch statement inside a loop.
  133. * tree-flow.h (var_ann_d): Add "current_def" field.
  134. (register_new_def): Lose last argument (currdefs table).
  135. * tree-into-ssa.c (currdefs): Remove.
  136. (rewrite_into_ssa): Initialize current_def field on each variable's
  137. annotation. Remove initialization/clearing of currdefs.
  138. (set_value_for, get_value_for): Kill.
  139. (rewrite_initialize_block): Update call to register_new_def.
  140. (rewrite_stmt): Similarly.
  141. (rewrite_finalize_block): Get/set a _DECL node's current
  142. definition from its annotation.
  143. (get_reaching_def): Similarly.
  144. (register_new_def): Similarly. Lose last argument.
  145. * tree-ssa-dom.c (currdefs): Remove.
  146. (get_value_for, set_value_for): Simplify.
  147. (tree_ssa_dominator_optimize): Initialize current_def on each
  148. variable's annotation. Remove initialization/clearing of currdefs.
  149. (thread_across_edge): Lose unnecessary argument to register_new_def.
  150. (record_equivalences_from_phis): Likewise.
  151. (register_definitions_for_stmt): Likewise.
  152. (restore_currdefs_to_original_value): Get/set a _DECL node's current
  153. definition from its annotation. Lose unnecessary "table" argument.
  154. (dom_opt_finalize_block): Corresponding changes.
  155. * tree-dfa.c (free_df_for_stmt): Release memory back to the GC
  156. system immediately.
  157. 2004-04-21 Ben Elliston <bje@au.ibm.com>
  158. PR middle-end/14730
  159. * expr.c (expand_expr_real_1) <SWITCH_EXPR>: Discard out of bounds
  160. case label values and ranges. Saturate case range values that
  161. exceed the minimum or maximum permitted value for the controlling
  162. expression type to TYPE_MIN_VALUE or TYPE_MAX_VALUE.
  163. 2004-04-20 Jeff Law <law@redhat.com>
  164. * tree-into-ssa.c (register_new_def): Avoid pushing useless
  165. information onto the block local definition stack.
  166. * tree-into-ssa.c (register_new_def): If there is no current
  167. reaching definition for SSA_NAME_VAR (DEF), then just push
  168. SSA_NAME_VAR (DEF) onto the stack.
  169. (rewrite_finalize_block): If we pop a _DECL node from the stack,
  170. then the _DECL node has no current reaching definition.
  171. * tree-ssa-dom.c (restore_currdefs_to_original_value): Similarly.
  172. 2004-04-19 Jeff Law <law@redhat.com>
  173. * tree-ssa-dom.c: Reinstate all changes from 2004-04-12.
  174. (lookup_avail_expr): Do not access a hash table object after
  175. it has been freed.
  176. 2004-04-19 Daniel Berlin <dberlin@dberlin.org>
  177. * doc/passes.texi: Add blurb about PRE.
  178. 2004-04-19 Andrew Pinski <pinskia@physics.uc.edu>
  179. * tree-ssa-phiopt.c (conditional_replacement):
  180. Catch some more non-gimple.
  181. 2004-04-19 Jan Hubicka <jh@suse.cz>
  182. * predict.c (combine_predictions_for_bb): Fix pasto.
  183. 2004-04-18 Jan Hubicka <jh@suse.cz>
  184. * tree-inline.c (estimate_num_insn_1): Deal properly with
  185. builtin_constant_p and builtin_expect.
  186. 2004-04-17 Andrew MacLeod <amacleod@redhat.com>
  187. * doc/invoke.texi (tree-ter, tree-lrs): Document options.
  188. 2004-04-17 Paul Brook <paul@codesourcery.com>
  189. * Makefile.in: Set GMPLIBS and GMPINC.
  190. * configure.ac: Add GMPLIBS and GMPINC.
  191. * configure: Regenerate.
  192. 2004-04-16 Andrew MacLeod <amacleod@redhat.com>
  193. * common.opt (ftree-lrs): New common option.
  194. * flags.h (flag_tree_live_range_split): New flag.
  195. * opts.c (decode_options): Turn on LRS by default.
  196. (common_handle_option): Set LRS flag to specified value.
  197. * toplev.c (flag_tree_live_range_split): Initialize.
  198. (lang_independent_options f_): Add tree-lrs.
  199. * tree-outof-ssa.c (rewrite_out_of_ssa): Use LRS flag.
  200. * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Don't coalesce
  201. variables if one is a hardware register. Coalesce inlined user vars.
  202. (rename_ssa_copies): Scan blocks first, then PHI nodes.
  203. 2004-04-15 Andrew Pinski <pinskia@physics.uc.edu>
  204. * builtins.c (fold_builtin_isascii): Do not return non-gimple
  205. code when we are in gimple form.
  206. (fold_builtin_isdigit): Do not return non-gimple
  207. code when we are in gimple form.
  208. * c-simplify.c (gimplify_decl_stmt): Handle TYPE_DECL.
  209. 2004-04-14 Paul Brook <paul@codesourcery.com>
  210. * Makefile.in (GMPLIBS, GMPINC): Don't set.
  211. * configure.ac: Remove checks for GMP.
  212. * configure: Regenerate.
  213. 2004-04-13 Diego Novillo <dnovillo@redhat.com>
  214. * fold-const.c, tree-ssa-ccp.c, tree-ssa-dom.c,
  215. tree-ssa.c, tree.c: Replace all uses of TREE_UNSIGNED with
  216. TYPE_UNSIGNED or DECL_UNSIGNED.
  217. * c-semantics.c (build_stmt): Don't check type nodes for
  218. side effects.
  219. 2004-04-13 Jeff Law <law@redhat.com>
  220. * tree-ssa-dom.c: Revert all changes from 2004-04-12.
  221. 2004-04-12 Jeff Law <law@redhat.com>
  222. * tree-ssa-dom.c (struct expr_hash_elt): Add new field for hash value.
  223. (initialize_hash_element): New LHS argument. Callers changed.
  224. Initialize the hash value field.
  225. (remove_local_expressions_from_table): Use htab_remove_elt_with_hash.
  226. (update_rhs_and_lookup_avail_expr): Similary.
  227. (lookup_avail_expr): Use htab_find_slot_with_hash. Simplify slightly
  228. and pass LHS to initialize_hash_element.
  229. (record_cond): Also use htab_find_slot_with_hash. Initialize the
  230. hash table entry with initialize_hash_element.
  231. (avail_expr_eq): Use the saved hash value rather than calling into
  232. the hash functions again.
  233. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Slightly rearrange
  234. code to clear tables before each iteration to be clearer.
  235. * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Use
  236. DEF_OPS and VDEF_OPS instead of STMT_DEF_OPS and STMT_VDEF_OPS.
  237. 2004-04-12 Diego Novillo <dnovillo@redhat.com>
  238. * flags.h (flag_tree_loop): Remove. Update all users.
  239. * opts.c (common_handle_option) <OPT_ftree_loop_optimize>: Remove.
  240. * toplev.c (f_options): Remove -ftree-loop-optimize.
  241. * tree-optimize.c (init_tree_optimization_passes): Don't
  242. schedule pass_loop.
  243. * tree-ssa-loop.c (tree_ssa_loop_opt): Remove.
  244. (gate_loop): Remove.
  245. * doc/invoke.texi: Remove documentation for -ftree-loop-optimize.
  246. 2004-04-12 Diego Novillo <dnovillo@redhat.com>
  247. * c-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): Remove.
  248. * c-semantics.c (expand_stmt_toplev): Remove.
  249. * langhooks-def.h (LANG_HOOKS_RTL_EXPAND_INITIALIZER): Remove.
  250. (LANG_HOOKS_RTL_EXPAND_START): Remove.
  251. (LANG_HOOKS_RTL_EXPAND_STMT): Remove.
  252. (LANG_HOOKS_RTL_EXPAND_END): Remove.
  253. * langhooks.h (struct lang_hooks_for_rtl_expansion): Remove.
  254. (struct lang_hooks): Update.
  255. * tree-optimize.c (tree_rest_of_compilation): Don't call
  256. lang_hooks.rtl_expand.start nor lang_hooks.rtl_expand.end.
  257. Call expand_expr_stmt_value instead of
  258. lang_hooks.rtl_expand.stmt.
  259. * objc/objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): Remove.
  260. 2004-04-12 Richard Henderson <rth@redhat.com>
  261. * c-common.c (c_do_switch_warnings): Use EXPR_LOCUS instead
  262. of STMT_LINENO.
  263. (c_walk_subtrees): Likewise.
  264. (c_estimate_num_insns_1): Remove FILE_STMT.
  265. * c-common.def (FILE_STMT): Remove.
  266. * c-common.h (FILE_STMT_FILENAME_NODE): Remove.
  267. (FILE_STMT_FILENAME, STMT_LINENO, STMT_LINENO_FOR_FN_P): Remove.
  268. (c_common_stmt_codes): Remove FILE_STMT.
  269. * c-dump.c (dump_stmt): Use EXPR_LOCUS instead of STMT_LINENO.
  270. * c-parse.in (lineno_stmt, lineno_label): Likewise.
  271. * c-pretty-print.c (pp_c_statement): Remove FILE_STMT.
  272. * c-semantics.c (add_stmt): Don't emit FILE_STMT. Do set
  273. EXPR_LOCUS if not yet set.
  274. (finish_stmt_tree): Don't set line for end of function.
  275. (build_stmt): Set EXPR_LOCUS instead of STMT_LINENO.
  276. (prep_stmt): Use EXPR_LOCUS instead of STMT_LINENO.
  277. * c-simplify.c (c_gimplify_stmt): Remove FILE_STMT.
  278. (gimplify_block): Save and restore entire locus.
  279. (stmt_expr_last_stmt): Use EXPR_LOCUS instead of STMT_LINENO.
  280. * doc/c-tree.texi (FILE_STMT, FILE_STMT_FILENAME, STMT_LINENO): Remove.
  281. 2004-04-12 Jeff Law <law@redhat.com>
  282. * tree-ssa-dom.c (true_exprs, false_exprs): Kill.
  283. (struct expr_hash_elt): New structure for the expression hash table.
  284. (struct dom_walk_block_data): Kill block local true_exprs and
  285. false_exprs.
  286. (get_eq_expr_value): One less local varray argument. Fix prototype.
  287. Use record_cond rather than record_cond_is_{true,false}.
  288. (true_false_expr_hash, true_false_expr_eq): Kill.
  289. (record_cond_is_true, record_cond_is_false): Collapse into ...
  290. (record_cond): New function.
  291. (tree_ssa_dominator_optimize): Kill references to true_exprs and
  292. false_exprs. Use "free" as the free function for the avail_exprs
  293. hash table.
  294. (dom_opt_initialize_block_local_data): No longer initialize
  295. block local true/false expressions.
  296. (initialize_hash_element): New function.
  297. (remove_local_expressions_from_table): Use initialize_hash_element.
  298. (update_rhs_and_lookup_avail_expr): Similarly.
  299. (dom_opt_finalize_block): Record true/false expressions into the
  300. main avail_expr hash table. Unwind main hash table appropriately.
  301. Use record_cond rather than record_cond_is_{true,false}.
  302. (record_equivalences_from_incoming_edge): Pass block local avail_exprs
  303. varray instead of block local true/false varrays to get_eq_expr_value.
  304. (dump_dominator_optimization_stats): Update to reflect that the
  305. true/false expression hash tables are gone.
  306. (lookup_avail_expr): Simplify slightly now that we only have one
  307. expression hash table.
  308. (avail_expr_hash, avail_expr_eq): Generalize slightly to handle new
  309. hash table entry structure and having true/false expression information
  310. in the available expression hash table.
  311. 2004-04-09 Jeff Law <law@redhat.com>
  312. * tree-ssa_dom.c (register_definitions_for_stmt): Accept a statement
  313. annotation rather than the statement itself. Callers changed.
  314. Use [V]DEF_OPS rather than STMT_[V]DEF_OPS.
  315. * tree-ssa-operands.c (get_stmt_operands): Slightly reorganize to
  316. avoid unnecessary calls to stmt_ann.
  317. * tree-ssa-pre.c (expr_phi_insertion): Get the statement's annotation
  318. and use [V]USE_OPS rather than STMT_[V]USE_OPS.
  319. (same_e_version_phi_result): Similarly
  320. (process_left_occs_and_kills): Similarly for [V]DEF_OPS and
  321. STMT_[V]DEF_OPS.
  322. * tree-ssa.c (replace_immediate_uses): Similarly.
  323. (verify_ssa): Similarly. Also verify that VDEF_OPs uses are dominated
  324. by their sets.
  325. * tree-into-ssa.c (insert_phi_nodes_for): Use passed in worklist
  326. varray instead of allocated one for every variable we rewrite into
  327. SSA form.
  328. (insert_phi_nodes_1): Pass worklist varray from caller to
  329. insert_phi_nodes_for.
  330. (insert_phi_nodes): Allocate a worklist for insert_phi_nodes_for
  331. and pass it to insert_phi_nodes_1.
  332. 2004-04-08 Jeff Law <law@redhat.com>
  333. * tree-ssa-dom.c (nonzero_vars): Turn it into a bitmap.
  334. (tree_ssa_dominator_optimize): Update initialization, clearing and
  335. freeing of nonzero_vars.
  336. (restore_nonzero_vars_to_original_value): New function.
  337. (dom_opt_finalize_block): Use it.
  338. (record_var_is_nonzero): Only record the variable into the block
  339. local nonzero vars array if it did not already have a nonzero property.
  340. (lookup_avail_expr): Lookup the nonzero property of an SSA_NAME with
  341. a bitmap test.
  342. * fold-const.c (fold): Remove attempt to share code which
  343. simplifies tests against the highest/lowest value of a
  344. range between the main folder and the nondestructive folder.
  345. 2004-04-08 Brian Booth <bbooth@redhat.com>
  346. Diego Novillo <dnovillo@redhat.com>
  347. * tree-into-ssa.c (invalidate_name_tags): New function.
  348. Mark aliases of invalidated name tags for renaming.
  349. (rewrite_into_ssa): Call invalidate_name_tags.
  350. 2004-04-07 Diego Novillo <dnovillo@redhat.com>
  351. * gimplify.c (gimplify_call_expr): Remove argument POST_P.
  352. Update all callers.
  353. Don't use POST_P when gimplifying the call expression.
  354. 2004-04-07 Diego Novillo <dnovillo@redhat.com>
  355. * doc/tree-ssa.texi: Add documentation for the dominator
  356. walker.
  357. 2004-04-07 Andrew MacLeod <amacleod@redhat.com>
  358. * tree-outof-ssa.c: Update comments and reformat for legibility.
  359. * tree-ssa-copyrename.c: Update comments and reformat for legibility.
  360. * tree-ssa-live.c: Update comments and reformat for legibility.
  361. * tree-ssa-live.h: Update comments and reformat for legibility.
  362. 2004-04-07 Diego Novillo <dnovillo@redhat.com>
  363. * gimplify.c (gimplify_call_expr): Don't use POST_P when
  364. gimplifying CALL_EXPR arguments.
  365. 2004-04-06 Diego Novillo <dnovillo@redhat.com>
  366. * tree-dfa.c: Update comments and reformat for legibility.
  367. (find_vars_r): Remove special casing of MODIFY_EXPR and
  368. simplify logic.
  369. (compute_reached_uses, compute_reaching_defs, remove_decl,
  370. find_decl_location): Remove.
  371. (discover_nonconstat_array_refs_r,
  372. discover_nonconstant_array_refs): Move ...
  373. * tree-outof-ssa.c: ... here.
  374. 2004-04-05 Richard Henderson <rth@redhat.com>
  375. * tree-simple.c (is_gimple_min_invariant): Disallow &a+i.
  376. * tree-ssa-ccp.c (maybe_fold_stmt_addition): Rename from
  377. maybe_fold_stmt_plus. Handle MINUS_EXPR.
  378. (fold_stmt_r): Pass MINUS_EXPR to it.
  379. 2004-04-05 Ben Elliston <bje@au.ibm.com>
  380. * Makefile.in (OBJS-common): Remove tree-browser.o.
  381. (cc1): Depend on @TREEBROWSER@ and include in list of objects.
  382. * configure.ac: Add --enable-tree-browser option.
  383. * configure: Rebuild.
  384. 2004-04-05 Andrew Pinski <pinskia@physics.uc.edu>
  385. * tree-ssa-ccp.c (fold_stmt_r): Fix whitespace formatting.
  386. (set_rhs): Likewise.
  387. 2004-04-03 Paolo Bonzini <bonzini@gnu.org>
  388. Diego Novillo <dnovillo@redhat.com>
  389. * tree-alias-common.c (find_func_aliases): Support
  390. assigning to BIT_FIELD_REFs.
  391. * tree-cfg.c (verify_expr): Don't allow assign to
  392. a register with BIT_FIELD_REF.
  393. * tree-dfa.c (get_virtual_var): Add consistency check on
  394. the shape of expected VARs.
  395. (discover_nonconstant_array_refs_r): Go through BIT_FIELD_REFs.
  396. * tree-simple.c: Document that BIT_FIELD_REFs are valid lvalues.
  397. * tree-ssa.c (set_is_used): Go through BIT_FIELD_REFs.
  398. * tree-ssa-operands.c (get_expr_operands): Mark VA_ARG_EXPR
  399. nodes as making volatile references.
  400. 2004-04-02 Fariborz Jahanian <fjahanian@apple.com>
  401. * c-convert.c (convert): Make convert work when converting
  402. to compatible types across translation unit.
  403. 2004-04-02 Andrew Pinski <pinskia@physics.uc.edu>
  404. * Makefile.in (stage2_build): Remove support for
  405. rebuilding libbanshee.
  406. * configure.ac: Remove support for rebuilding
  407. libbanshee.
  408. * config.gcc (powerpc-*-darwin*): Do not rebuild
  409. libbanshee.
  410. 2004-04-01 Kazu Hirata <kazu@cs.umass.edu>
  411. * tree-ssa-forwprop.c: Add a comment about forward propagation
  412. of TRUTH_NOT_EXPR.
  413. 2004-04-01 Diego Novillo <dnovillo@redhat.com>
  414. * tree-optimize.c (tree_rest_of_compilation): Fix typo in
  415. setting of in_gimple_form.
  416. 2004-04-01 Jeff Law <law@redhat.com>
  417. * fold-const.c (fold_relational_hi_lo): Do not return non-gimple
  418. code when we are in gimple form.
  419. * tree-optimize.c (tree_rest_of_compilation): Note when we are in
  420. gimple form.
  421. * tree-ssa-ccp.c (ccp_fold): Tighten tests on return value from
  422. nondestructive_fold_{unary,binary}_to_constant.
  423. * tree.h (in_gimple_form): Declare.
  424. * tree-ssa.c (ssa_remove_edge): Correct looping structure.
  425. (ssa_redirect_edge): Similarly
  426. 2004-03-30 Brian Booth <bbooth@redhat.com>
  427. * tree-pretty-print.c (dump_vops): Add flags argument and
  428. propagate it to dump_generic_node calls.
  429. (dump_generic_node): Update dump_vops call.
  430. 2004-03-29 Diego Novillo <dnovillo@redhat.com>
  431. * configure.ac: Emit confirmation messages for libbanshee.
  432. * configure: Regenerate.
  433. 2004-03-29 Jan Hubicka <jh@suse.cz>
  434. PR 14756
  435. * cgraphunit.c (cgraph_decide_inlining): Rewrite handling of
  436. always_inline functions.
  437. 2004-03-28 Jan Hubicka <jh@suse.cz>
  438. * tree-inline.c (expand_call_inline): Remove fixme introduced by
  439. nested function patch.
  440. 2004-03-26 Diego Novillo <dnovillo@redhat.com>
  441. * tree-ssa-operands.c (get_stmt_operands): Remove always-true
  442. predicate.
  443. * tree-ssa-alias.c (maybe_create_global_var): Create
  444. .GLOBAL_VAR if there are no call-clobbered variables.
  445. * tree-ssa-operands.c (get_stmt_operands): Add call-clobbering
  446. VDEFs for asm ("":::"memory") if there are call-clobbered
  447. variables or if .GLOBAL_VAR has been created.
  448. 2004-03-26 Diego Novillo <dnovillo@redhat.com>
  449. * passes.c (rest_of_compilation): Re-enable .01.rtl
  450. dumps.
  451. 2004-03-25 Diego Novillo <dnovillo@redhat.com>
  452. * tree-pretty-print.c (dump_generic_node) <WITH_RECORD_EXPR>: Remove.
  453. * tree-inline.c (estimate_num_insns_1) <WITH_RECORD_EXPR>: Remove.
  454. * fold-const.c (fold_relational_hi_lo): Change type of argument
  455. 'type_p' to const tree and rename it to 'type'. Update
  456. all callers.
  457. 2004-03-25 Diego Novillo <dnovillo@redhat.com>
  458. * Makefile.in (C_AND_OBJC_OBJS): Remove c-call-graph.o
  459. (c-call-graph.o): Remove.
  460. * c-call-graph.c: Remove.
  461. * c-tree.h (print_call_graph): Remove.
  462. (debug_call_graph): Remove.
  463. * tree-cfg.c: Update/add comments everywhere.
  464. (pre_insert_on_edge): Rename from bsi_insert_on_edge_immediate.
  465. * tree-flow.h (build_tree_cfg): Make static.
  466. (tree_cfg2dot): Likewise.
  467. (verify_stmt): Likewise.
  468. * tree-ssa-pre.c (insert_one_operand): Call pre_insert_on_edge.
  469. 2004-03-25 Diego Novillo <dnovillo@redhat.com>
  470. * tree-ssa-alias.c (struct alias_info): Change type of field
  471. 'num_references' to varray_type. Update all users.
  472. 2004-03-24 Jeff Law <law@redhat.com>
  473. * c-mudflap (mflang_flush_calls): Use push_scope/pop_scope instead
  474. of pushlevel and poplevel.
  475. 2004-03-23 Richard Henderson <rth@redhat.com>
  476. PR middle-end/14694
  477. * c-common.c (handle_alias_attribute): Mark aliased variables
  478. to be TREE_STATIC.
  479. 2004-03-23 Jeff Law <law@redhat.com>
  480. * tree-into-ssa.c (register_new_def): Lose unnecessary VAR argument,
  481. instead derive VAR from DEF argument.
  482. (rewrite_initialize_block, rewrite_stmt, rewrite_operand): Corresponding
  483. changes.
  484. * tree-ssa-dom.c (register_definitions_for_stmt): Corresponding changes.
  485. (record_equivalences_from_phis): Likewise.
  486. (restore_currdefs_to_original_value): New, extracted from ...
  487. (dom_opt_finalize_block): Use restore_currdefs_to_original_value.
  488. Restore currdefs after threading across a true edge.
  489. (thread_across_edge): Register new defintions when we walk through
  490. a PHI node or real statement.
  491. * tree-flow.h (register_new_def): Updated.
  492. 2004-03-23 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  493. * tree-ssa-dce.c (find_obviously_necessary_stmts,
  494. perform_tree_ssa_dce): Do not remove loops.
  495. 2004-03-19 Diego Novillo <dnovillo@redhat.com>
  496. PR optimization/14643
  497. * tree-ssa-alias.c (group_aliases_into): Don't add a variable
  498. to its own may-alias set.
  499. (create_alias_map_for): New.
  500. (setup_pointers_and_addressables): Call it.
  501. Fix allocation of AI->ADDRESSABLE_VARS and AI->POINTERS.
  502. If there are no addressable variables and more than one
  503. dereferenced pointers, add type tags to the ADDRESSABLE_VARS
  504. array.
  505. (get_tmt_for): Add comment about using alias set equality when
  506. checking for existing tags.
  507. 2004-03-19 Kazu Hirata <kazu@cs.umass.edu>
  508. * fold-const.c (fold_relational_const): Remove dead code.
  509. 2004-03-19 Dale Johannesen <dalej@apple.com>
  510. * tree-ssa-dse.c (dse_optimize_stmt): Redirect uses feeding into
  511. a deleted store correctly.
  512. 2004-03-19 Jeff Law <law@redhat.com>
  513. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Fix typo.
  514. Eliminate unnecessary test of VAL.
  515. * tree-dfa.c (find_hidden_use_vars): Also look inside the
  516. PENDING_SIZES list for hidden uses.
  517. * tree-optimize.c (tree_rest_of_compilation): Expand used variables
  518. before setting up parameters.
  519. * tree-ssa-copyrename.c (rename_ssa_copies): Do nothing for copies
  520. where the LHS has a hidden use.
  521. 2004-03-18 Diego Novillo <dnovillo@redhat.com>
  522. * Makefile.in (TREE_FLOW_H): Reformat.
  523. (OBJS-common): Add tree-into-ssa.o and tree-outof-ssa.o.
  524. (tree-ssa.o): Remove dependency on domwalk.h and tree-ssa-live.h
  525. (tree-into-ssa.o): New.
  526. (tree-outof-ssa.o): New.
  527. (GTFILES): Remove tree-ssa.c.
  528. (gt-tree-ssa.h): Remove.
  529. * tree-into-ssa.c: New file.
  530. Move all the functions used to rename into SSA from tree-ssa.c.
  531. Update/add comments.
  532. Remove unused variables and structures.
  533. Don't use GGC for memory allocation.
  534. * tree-outof-ssa.c: New file.
  535. Move all the functions used to rename out of SSA from
  536. tree-ssa.c.
  537. Update/add comments.
  538. * tree-ssa-alias.c (compute_points_to_and_addr_escape): Add
  539. bibliographic reference.
  540. 2004-03-18 Jeff Law <law@redhat.com>
  541. * Makefile.in (tree-tailcall.o): Depend on langhooks.h.
  542. * tree-tailcall.c: Include langhooks.h.
  543. (find_tail_calls): Use types_compatible_p langhook instead of
  544. equality test of TYPE_MAIN_VARIANT.
  545. * tree-nested.c (get_chain_decl): Mark the chain decl with
  546. TREE_NO_WARNING.
  547. 2004-03-18 Devang Patel <dpatel@apple.com>
  548. * tree-ssa-live.c (new_tree_live_info): Set num_blocks to
  549. last_basic_block instead of n_basic_blocks.
  550. (calculate_live_on_entry): Use last_basic_block instead of
  551. n_basic_blocks.
  552. (calculate_live_on_exit): Same.
  553. 2004-03-17 Jeff Law <law@redhat.com>
  554. * tree-tailcall.c (find_tail_calls): Tighten test for tail recursion.
  555. 2004-03-17 Diego Novillo <dnovillo@redhat.com>
  556. PR optimization/14511
  557. * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Do not
  558. ignore read-only variables.
  559. (may_alias_p): Fix pointer-to-var calculation when 'var' is an
  560. array.
  561. 2004-03-17 Jan Hubicka <jh@suse.cz>
  562. * tree-ssa.c (rewrite_into_ssa, compute_global_livein): Fix.
  563. 2004-03-17 Paolo Bonzini <bonzini@gnu.org>
  564. * builtins.c (expand_builtin_constant_p,
  565. purge_builtin_constant_p): Remove.
  566. (expand_builtin): Expand __builtin_constant_p to zero.
  567. * function.c (struct function): Remove calls_constant_p.
  568. (current_function_calls_constant_p): Remove.
  569. * passes.c (rest_of_handle_gcse): Do not run
  570. purge_builtin_constant_p.
  571. * rtl.def (CONSTANT_P_RTX): Die die die.
  572. * cse.c (fold_rtx): Do not handle CONSTANT_P_RTX.
  573. * expr.c (emit_move_insn): Likewise.
  574. * gcse.c (want_to_gcse_p, gcse_constant_p): Likewise.
  575. * genrecog.c (validate_pattern): Likewise.
  576. * recog.c (immediate_operand): Likewise.
  577. * rtl.h (CONSTANT_P): Likewise.
  578. * simplify-rtx.c (simplify_rtx): Likewise.
  579. * config/alpha/alpha.c (input_operand): Likewise.
  580. * config/arm/arm.c (THUMB_LEGITIMATE_CONSTANT_P): Likewise.
  581. * config/c4x/c4x.c (const_operand): Likewise.
  582. * config/cris/cris.c (cris_gotless_symbol,
  583. cris_got_symbol): Likewise.
  584. * config/frv/frv.h (LEGITIMATE_PIC_OPERAND_P): Likewise.
  585. * config/ia64/ia64.c (gr_reg_or_5bit_operand,
  586. gr_reg_or_6bit_operand, gr_reg_or_8bit_operand,
  587. gr_reg_or_8bit_adjusted_operand,
  588. gr_reg_or_8bit_and_adjusted_operand,
  589. gr_reg_or_14bit_operand, gr_reg_or_22bit_operand,
  590. shift_count_operand, shift_32bit_count_operand): Likewise.
  591. * config/m32r/m32r.c (move_src_operand): Likewise.
  592. * config/mips/mips.c (mips_const_insns): Likewise.
  593. * config/mmix/mmix.c (mmix_constant_address_p): Likewise.
  594. * config/pa/pa.c (move_src_operand): Likewise.
  595. * config/rs6000/rs6000.c (input_operand): Likewise.
  596. * config/sparc/sparc.c (input_operand): Likewise.
  597. * config/v850/v850.c (movsi_source_operand): Likewise.
  598. * config/xtensa/xtensa.c (move_operand,
  599. xtensa_emit_move_sequence): Likewise.
  600. * config/ia64/ia64.h (PREDICATE_CODES): Do not mention CONSTANT_P_RTX.
  601. * config/pa/pa.h (PREDICATE_CODES): Likewise.
  602. 2004-03-16 Diego Novillo <dnovillo@redhat.com>
  603. * tree-dump.c (struct dump_option_value_info): Add TDF_UID.
  604. * tree.h (TDF_UID): Define.
  605. * doc/invoke.texi: Document -ftree-dump-...-uid.
  606. * tree-pretty-print.c (debug_generic_expr): Add TDF_UID.
  607. (debug_generic_stmt): Likewise.
  608. (dump_decl_name): New function.
  609. (dump_generic_node): Call it.
  610. (print_declaration): Add new argument 'flags'. Update all users.
  611. (print_struct_decl): Likewise.
  612. * tree-alias-ander.c, tree-cfg.c, tree-dfa.c, tree-mudflap.c,
  613. tree-nrv.c, tree-sra.c, tree-ssa-alias.c, tree-ssa-ccp.c,
  614. tree-ssa-copy.c, tree-ssa-dom.c, tree-ssa-dse.c,
  615. tree-ssa-forwprop.c, tree-ssa-operands.c, tree-ssa-pre.c,
  616. tree-ssa.c, tree-tail-call.c: Call print_generic_* with
  617. 'dump_flags'.
  618. 2004-03-16 Dale Johannesen <dalej@apple.com>
  619. * Makefile.in (tree-ssa-phiopt.o): add langhooks.h dependency.
  620. (tree-nrv.o): Ditto.
  621. (tree-ssa-copy.o): Ditto.
  622. (tree-ssa-dom.o): Ditto.
  623. (tree-ssa-ccp.o): Ditto.
  624. * c-common.c: Add #include hashtab.h.
  625. (c_type_hash): New.
  626. (c_common_get_alias_set): Handle multiple type nodes referring
  627. to "the same" type, currently for C90 only.
  628. * c-decl.c (current_file_decl): Move to toplev.c.
  629. * c-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Define to
  630. c_types_compatible_p.
  631. (c_types_compatible_p): New.
  632. * c-tree.h (c_types_compatible_p): New declaration.
  633. * c-typeck.c (tagged_types_tu_compatible_p): Allow for
  634. compiler-generated TYPE_DECLs without a DECL_ORIGINAL_TYPE.
  635. * gimplify.c (canonicalize_addr_expr): Use types_compatible_p langhook.
  636. (cpt_same_type): Ditto.
  637. * langhooks-def.h (lhd_types_compatible_p): New declaration.
  638. LANG_HOOKS_TYPES_COMPATIBLE_P: New.
  639. * langhooks.c (lhd_types_compatible_p): New.
  640. * langhooks.h (struct lang_hooks): Add types_compatible_p.
  641. * stmt.c (tail_recursion_args): Use types_compatible_p langhook.
  642. * toplev.c (current_file_decl): New, moved from c-decl.c.
  643. * tree-nrv.c: Include langhooks.h.
  644. (tree_nrv): Use types_compatible_p langhook.
  645. * tree-ssa-ccp.c: Include langhooks.h.
  646. (maybe_fold_offset_to_array_ref): Use types_compatible_p langhook.
  647. (maybe_fold_offset_to_component_ref): Ditto (2 places).
  648. (fold_stmt_r): Make sure rhs of COMPONENT_REF is in lhs type.
  649. * tree-ssa-copy.c: Include langhooks.h.
  650. (cprop_into_stmt): Use types_compatible_p langhook.
  651. * tree-ssa-dom.c: Include langhooks.h.
  652. (avail_expr_p): Use types_compatible_p langhook.
  653. * tree-ssa-phiopt.c: Include langhooks.h.
  654. (conditional_replacement): Use types_compatible_p langhook.
  655. * tree-ssa.c (tree_ssa_useless_type_conversion_1): Use
  656. types_compatible_p langhook.
  657. * tree.h (current_file_decl): New declaration.
  658. 2004-03-16 Dale Johannesen <dalej@apple.com>
  659. PR optimization/14498
  660. * gimplify.c (copy_if_shared_r): Mark VA_ARGS_EXPRs as volatile.
  661. (mark_decls_volatile_r): Moved higher in file (unchanged).
  662. 2004-03-16 Daniel Berlin <dberlin@dberlin.org>
  663. PR optimization/14562
  664. * tree-ssa-pre.c (generate_expr_as_of_bb): Don't use names_match_p.
  665. (generate_vops_as_of_bb): Ditto.
  666. 2004-03-12 Diego Novillo <dnovillo@redhat.com>
  667. PR optimization/14553
  668. * tree-ssa.c (replace_immediate_uses): Call propagate_value to
  669. update operands.
  670. 2004-03-12 Diego Novillo <dnovillo@redhat.com>
  671. * tree-alias-common.c (create_alias_vars): Add #if
  672. HAVE_BANSHEE around test for PTA_ANDERSEN.
  673. 2004-03-11 Diego Novillo <dnovillo@redhat.com>
  674. * tree-dfa.c (struct walk_state): Remove fields 'is_store' and
  675. 'is_indirect_ref'. Update all users.
  676. * tree-flow.h (struct var_ann_d): Remove fields 'is_stored',
  677. 'is_dereferenced_store' and 'is_dereferenced_load'. Update
  678. all users.
  679. * tree-simple.c (get_base_address): Handle BIT_FIELD_REF.
  680. * tree-ssa-alias.c (struct alias_info): Add fields
  681. 'written_vars', 'dereferenced_ptrs_store' and
  682. 'dereferenced_ptrs_load'.
  683. (init_alias_info): Initialize them.
  684. (delete_alias_info): Free them.
  685. (find_ptr_dereference): New.
  686. (ptr_is_dereferenced_by): Call it.
  687. Add new argument 'is_store'. Set to true if the
  688. expression is an indirect store operation.
  689. (compute_points_to_and_addr_escape): If the statement
  690. makes a store, load or write operation, update the
  691. corresponding bitmap.
  692. (compute_flow_insensitive_aliasing): Test the
  693. 'written_vars' bitmap to determine if alias sets should
  694. be computed.
  695. (setup_pointers_and_addressables): Always assume that
  696. volatile pointers and hidden pointers have been used in a
  697. memory store operation.
  698. * tree-ssa-operands.c (add_stmt_operand): Do add an
  699. operand for may-aliased variables before computing
  700. aliases.
  701. 2004-03-11 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  702. * tree-optimize.c (init_tree_optimization_passes): Move
  703. pass_tail_recursion and pass_ch after pass_may_alias.
  704. * tree-ssa-loop.c (mark_defs_for_rewrite): Mark type tags
  705. for rewriting.
  706. * tree-ssa.c (mark_def_sites): Process the operand of a
  707. VDEF before the result.
  708. 2004-03-11 Richard Henderson <rth@redhat.com>
  709. PR 14204
  710. * tree-ssa.c (warn_uninit): Don't warn for hard register variables.
  711. 2004-03-10 Richard Henderson <rth@redhat.com>
  712. * tree-simple.c (get_base_var, get_base_decl): Remove.
  713. * tree-simple.h: Likewise.
  714. * tree-dfa.c (discover_nonconstant_array_refs_r): Use get_base_address.
  715. * tree-ssa-alias.c (ptr_is_dereferenced_by): Likewise.
  716. (add_pointed_to_var, is_escape_site): Likewise.
  717. * tree-ssa-ccp.c (get_default_value): Expect only SSA_NAME and DECLs.
  718. * tree-ssa-operands.c (add_stmt_operand): Likewise.
  719. (note_addressable): Use get_base_address.
  720. * tree-ssa-dce.c (need_to_preserve_store): Expect only SSA_NAME.
  721. * tree-ssa.c (set_is_used): Inline get_base_decl.
  722. 2004-03-10 Richard Henderson <rth@redhat.com>
  723. * tree-nested.c (convert_nonlocal_reference): Clear TREE_INVARIANT
  724. on modified ADDR_EXPRs.
  725. 2004-03-10 Andrew Pinski <apinski@apple.com
  726. PR c/14475
  727. * c-decl.c (check_bitfield_type_and_width): Check for null
  728. lang_type_specific when check the precision of an enum.
  729. 2004-03-09 Andrew Pinski <apinski@apple.com>
  730. * Makefile.in (tree-ssa-forwprop.o): Fix the dependences.
  731. 2004-03-09 Jeff Law <law@redhat.com>
  732. * tree-flow-inline.h (may_propagate_copy): Do not allow propagation of
  733. a constant for a virtual operand.
  734. 2004-03-08 Richard Henderson <rth@redhat.com>
  735. * calls.c (initialize_argument_information): Add
  736. parameter may_tail_call. Set to false for invisible
  737. pass-by-reference arguments that require stack
  738. allocation.
  739. Update all users.
  740. 2004-03-07 Jeff Law <law@redhat.com>
  741. * tree-ssa-dom.c: (get_eq_expr_value): Fix typo when comparing a
  742. boolean against a constant.
  743. * tree-ssa-forwprop.c (record_single_argument_cond_exprs): Do not
  744. record the same SSA_NAME more than once. Only record the SSA_NAME
  745. tested, not the COND_EXPR.
  746. (substitute_single_use_vars): Substitute booleans which are
  747. set from a TRUTH_NOT_EXPR even if they have more than one use site.
  748. 2004-03-05 Jeff Law <law@redhat.com>
  749. * tree-ssa-dce.c (remove_dead_stmt): Clear PENDING_STMT after
  750. redirect_edge_and_branch call.
  751. * tree-ssa-forwprop.c (record_single_argument_cond_exprs): Also
  752. record COND_EXPRs with single use vars defined by SSA_NAME + CONST
  753. expressions.
  754. (substitute_single_use_vars): Corresponding changes to rewrite
  755. COND_EXPRs using single use vars defined by SSA_NAME + CONST
  756. expressions.
  757. 2004-03-05 Ulrich Weigand <uweigand@de.ibm.com>
  758. * config/s390/s390.c (s390_expand_movstr): Do not use
  759. expand_exit_loop_top_cond, manually copy loop header.
  760. (s390_expand_clrstr): Likewise.
  761. (s390_expand_cmpmem): Likewise.
  762. 2004-03-04 Diego Novillo <dnovillo@redhat.com>
  763. * tree-ssa-alias.c (compute_flow_sensitive_aliasing): If
  764. a name tag has been marked call-clobbered, also mark the
  765. corresponding type tag.
  766. 2004-03-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  767. * tree-ssa-loop-live.c (coalesce_tpa_members): Update the root
  768. variable of the partition.
  769. 2004-03-04 Jeff Law <law@redhat.com>
  770. * tree-ssa-dce.c (remove_dead_stmt): Redirect an existing edge
  771. rather than deleting the old ones and creating a new one when
  772. removing a dead conditional.
  773. * fold-const.c (fold): When rebuilding the expression after a
  774. call to fold_relational_hi_lo, make sure to convert the type of
  775. the second argument to the type of the first.
  776. 2004-03-04 Diego Novillo <dnovillo@redhat.com>
  777. * cgraphunit.c (cgraph_optimize): Do not do memory release
  778. check if there have been errors.
  779. 2004-03-03 Jeff Law <law@redhat.com>
  780. * tree-ssa-phiopt.c (conditional_replacement): Clear EDGE_TRUE_VALUE
  781. and EDGE_FALSE_VALUE on the remaining edge after eliminating a PHI.
  782. 2004-03-03 Andrew MacLeod <amacleod@redhat.com>
  783. * tree-ssa-copyrename.c (gate_copyrename): Really check it in.
  784. * tree-ssa.c (create_temp): Use DECL_ARTIFICIAL from original decl.
  785. 2004-03-02 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  786. * tree-tailcall.c (struct tailcall): Remove return_block and return_bsi
  787. fields, add m and a fields.
  788. (m_acc, a_acc): New.
  789. (find_tail_calls): Find tail calls on whose results simple operations
  790. are performed.
  791. (independent_on_stmt_p, process_assignment,
  792. propagate_through_phis, adjust_accumulator_values,
  793. adjust_return_value): New.
  794. (eliminate_tail_call): Update the accumulators if needed.
  795. (optimize_tail_call): Do not create phis.
  796. (tree_optimize_tail_calls): Create phis and accumulators as needed.
  797. Adjust return values.
  798. 2004-03-02 Diego Novillo <dnovillo@redhat.com>
  799. * tree-ssa-operands.c (get_expr_operands): Mark CALL_EXPRs
  800. with has_volatile_ops if aliases haven't been computed yet.
  801. (add_stmt_operand): Use 'true' instead of '1'.
  802. 2004-03-02 Diego Novillo <dnovillo@redhat.com>
  803. PR optimization/14266
  804. * tree-ssa-alias.c (create_global_var): Mark GLOBAL_VAR for
  805. renaming.
  806. 2004-03-01 Richard Henderson <rth@redhat.com>
  807. * tree.c (associative_tree_code): Remove MINUS_EXPR, LSHIFT_EXPR,
  808. RSHIFT_EXPR.
  809. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Use
  810. is_gimple_min_invariant and is_gimple_var. Handle minus_expr
  811. specially.
  812. 2004-03-01 Richard Henderson <rth@redhat.com>
  813. * cfgbuild.c (rtl_make_eh_edge): Rename from make_eh_edge.
  814. * basic-block.h, except.c: Update decl and uses.
  815. 2004-03-01 Frank Ch. Eigler <fche@redhat.com>
  816. * doc/passes.texi: Add information about mudflap.
  817. 2004-03-01 Andrew Pinski <pinskia@physics.uc.edu>
  818. PR middle-end/13066
  819. * fold-const (fold): Call fold_convert when building
  820. a TRUTH_*_EXPR tree.
  821. 2004-03-01 Andrew MacLeod <amacleod@redhat.com>
  822. * common.opt : Add tree-copyrename option. Remove duplicate tree-sra.
  823. * flags.h (flag_tree_copyrename): Declare.
  824. * opts.c (decode_options): Turn copyrename on by default at -O.
  825. (common_handle_option): Handle -ftree-copyrename.
  826. * toplev.c (flag_tree_copyrename): Declare.
  827. * tree-ssa-copyrename.c (gate_copyrename): New. Check flag.
  828. (pass_rename_ssa_copies): Initialize with gated routine.
  829. (lang_independent_options f_): Add tree-copyrename.
  830. * doc/invoke.texi: Add -fdump-tree-copyrename and -ftree-copyrename.
  831. * doc/passes.texi: Add blurb for copy renaming.
  832. 2004-03-01 Jeff Law <law@redhat.com>
  833. * tree-ssa-dom.c (true_false_expr_hash): Update comments slightly.
  834. (true_false_expr_eq): Update comments slightly. Avoid using
  835. operand_equal_p, instead check the code and operands directly.
  836. 2004-03-01 Andrew MacLeod <amacleod@redhat.com>
  837. * Makefile.in (tree-ssa-copyrename.o): New object.
  838. * timevar.def (TV_TREE_COPY_RENAME): New time variable.
  839. * tree-optimize.c (init_tree_optimization_passes): Add copy rename
  840. pass.
  841. * tree-pass.h (pass_rename_ssa_copies): New pass structure.
  842. * tree-sra.c (lookup_scalar): Copy DECL_ARITIFICIAL flag from base.
  843. * tree-ssa-copyrename.c : New file.
  844. (copy_rename_partition_coalesce): Coalesce partitions for renaming.
  845. (rename_ssa_copies): Find renamable copies.
  846. (pass_rename_ssa_copies): Initialize.
  847. * tree-ssa-live.c (register_ssa_partition): Move to tree-ssa-live.h.
  848. * tree-ssa-live.h (register_ssa_partition): Moved from tree-ssa-live.c.
  849. 2004-02-29 David Edelsohn <edelsohn@gnu.org>
  850. * doloop.c (doloop_optimize): Increment n_iterations if loop->top
  851. present.
  852. 2004-02-29 Diego Novillo <dnovillo@redhat.com>
  853. * gimple-low.c (pass_remove_useless_vars): Add TODO_dump_func.
  854. 2004-02-27 Richard Henderson <rth@redhat.com>
  855. PR middle-end/14310
  856. * explow.c (emit_stack_save): Remove savearea mode check.
  857. 2004-02-27 Richard Henderson <rth@redhat.com>
  858. * builtins.c (simplify_builtin_strcmp): Don't export. Remove
  859. length parameters. Remove conversion to memcmp.
  860. (simplify_builtin_strncmp): Likewise.
  861. * expr.h: Don't declare them.
  862. * tree-ssa-ccp.c (ccp_fold_builtin): Don't call them.
  863. 2004-02-27 Dale Johannesen <dalej@apple.com>
  864. * tree-cfg.c (cleanup_control_expr_graph): Prevent edge
  865. probability from overflowing due to roundoff errors.
  866. 2004-02-27 Jeff Law <law@redhat.com>
  867. * tree-cfg.c (verify_expr): Do not walk down into types.
  868. Expand checking to verify that unary/binary operators have
  869. gimple operands.
  870. * tree-ssa-ccp.c (ccp_fold_builtin, case BUILT_IN_STRLEN): Do not
  871. create non-gimple code. Similarly for BUILTIN_IN_STRCPY and
  872. BUILT_IN_STRNCPY.
  873. * tree-ssa-phiopt.c (conditional_replacement): Do not create
  874. non-gimple code.
  875. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise.
  876. * tree-simple.c (is_gimple_min_invariant): Subtraction of a
  877. constant from a constant pointer is a gimple invariant as well.
  878. * tree-ssa-operands.c (get_expr_operands): Handle subtraction
  879. of a constant from a constant pointer too.
  880. * fold-const.c (fold): Tighten test for optimizing an equality
  881. comparison of the address of two variables.
  882. * tree-inline.c (setup_one_parameter): Improve test for when we
  883. need to gimplify the initialization statements.
  884. 2004-02-27 Diego Novillo <dnovillo@redhat.com>
  885. PR optimization/14312
  886. * tree-pretty-print.c (dump_generic_node): Mark tail calls.
  887. * tree-ssa-alias.c (compute_may_aliases): Restore call to
  888. dump_referenced_vars.
  889. (compute_points_to_and_addr_escape): If the address of a
  890. variable V is stored into a non-pointer variable, mark V as
  891. call-clobbered.
  892. * tree-tailcall.c (suitable_for_tail_opt_p): Check for
  893. call-clobbered instead of TREE_ADDRESSABLE.
  894. Ignore memory tags.
  895. (optimize_tail_call): Add newline to dump output.
  896. 2004-02-27 Diego Novillo <dnovillo@redhat.com>
  897. PR optimization/13347
  898. * tree-sra.c (scalarize_structure_assignment): Use STRIP_NOPS
  899. instead of STRIP_USELESS_TYPE_CONVERSION to remove type casts
  900. from RHS of the assignment.
  901. * tree-ssa.c (tree_ssa_useless_type_conversion_1): Reformat
  902. and rephrase comments.
  903. * tree.h (STRIP_USELESS_TYPE_CONVERSION): Reformat comment.
  904. 2004-02-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  905. * tree-cfg.c (tree_redirect_edge_and_branch_1): Allow to redirect
  906. RETURN_EXPR branches.
  907. 2004-02-26 Jeff Law <law@redhat.com>
  908. * tree-nrv.c (tree_nrv): Only perform NRV optimization when the
  909. return value lives in memory.
  910. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): If an
  911. operand is unsigned, then we can eliminate more ABS expressions
  912. and turned div/mod expression into shift/and expressions.
  913. * fold-const.c (fold): An equality comparison of the address of
  914. two non-weak variables has known compile-time result.
  915. 2004-02-26 Andrew Pinski <pinskia@physics.uc.edu>
  916. * tree-ssa-phiopt.c (conditional_replacement):
  917. s/tree_dump_flags/dump_flags/.
  918. * tree-ssa-phiopt.c (tree_ssa_phiopt): Split into ...
  919. (conditional_replacement): Here.
  920. 2004-02-26 Andrew MacLeod <amacleod@redhat.com>
  921. * tree-ssa.c (find_replaceable_in_bb): Don't repalce expressions in
  922. volatile statements.
  923. 2004-02-25 Richard Henderson <rth@redhat.com>
  924. PR opt/14288
  925. * gimplify.c (gimple_push_cleanup): Add VAR argument. Set
  926. TREE_NO_WARNING if in a conditional context.
  927. (gimplify_target_expr): Pass new argument.
  928. * tree-sra.c (lookup_scalar): Copy TREE_NO_WARNING to replacement.
  929. 2004-02-24 Kazu Hirata <kazu@cs.umass.edu>
  930. * doc/invoke.texi: Replace -fdump-tree-all-ssa with
  931. -fdump-tree-all.
  932. 2004-02-24 Kazu Hirata <kazu@cs.umass.edu>
  933. PR target/14285
  934. * config/arm/arm.c (arm_compute_func_type): Replace
  935. "current_function_needs_context" with "cfun->static_chain_decl
  936. != NULL".
  937. (arm_compute_initial_elimination_offset): Likewise.
  938. * config/h8300/h8300.c (h8300_emit_stack_adjustment):
  939. Likewise.
  940. * config/sh/sh.c (output_stack_adjust): Likewise.
  941. (sh5_schedule_saves): Likewise.
  942. * config/xtensa/xtensa.c (compute_frame_size): Likewise.
  943. 2004-02-24 Richard Henderson <rth@redhat.com>
  944. * c-simplify.c (c_genericize): s/dump_flags/local_dump_flags/.
  945. * predict.c, tree-alias-ander.c, tree-cfg.c, tree-nrv.c,
  946. tree-optimize.c, tree-pass.h, tree-sra.c, tree-ssa-alias.c,
  947. tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c,
  948. tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-loop.c,
  949. tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa.c, tree-tailcall.c:
  950. s/tree_dump_flags/dump_flags/.
  951. 2004-02-24 Richard Henderson <rth@redhat.com>
  952. * predict.c, tree-alias-ander.c, tree-cfg.c, tree-mudflap.c,
  953. tree-nrv.c, tree-optimize.c, tree-pass.h, tree-profile.c, tree-sra.c,
  954. tree-ssa-alias.c, tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-dce.c,
  955. tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-loop.c,
  956. tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa.c,
  957. tree-tailcall.c: s/tree_dump_file/dump_file/g.
  958. 2004-02-24 Diego Novillo <dnovillo@redhat.com>
  959. * doc/tree-ssa.texi: Fix formatting mark ups.
  960. 2004-02-24 Jeff Law <law@redhat.com>
  961. * gimple-low.c (remove_useless_vars): Now static.
  962. (pass_remove_useless_vars): New.
  963. * tree-flow.h (remove_useless_vars): Remove prototype.
  964. * tree-nrv.c (struct nrv_data): Remove visited hashtable.
  965. (finalize_nrv_r): Do not descend into types. No need to update
  966. the visited hashtable.
  967. (tree_nrv): No need to allocate/free the visited hashtable.
  968. Clear the used flag on the variable's annotation.
  969. * tree-optimize.c (init_tree_optimizatio_passes): Link in
  970. pass_remove_useless_vars.
  971. * tree-pass.h (pass_remove_useless_vars): Declare.
  972. * tree-ssa.c (rewrite_out_of_ssa): Do not remove useless vars here.
  973. * Makefile.in (OBJS-common): Add tree-nrv.o.
  974. (tree-nrv.o): Add dependencies.
  975. * timevar.def (TV_TREE_NRV): New timevar.
  976. * tree-nrv.c: New file implementing NRV on generic trees.
  977. * tree-optimize.c (init_tree_optimization_passes): Link in
  978. tree_nrv optimization pass.
  979. * tree-pass.h (tree_nrv): Declare.
  980. * doc/invoke.texi: Add -fdump-tree-nrv documentation.
  981. 2004-02-24 Sebastian Pop <sebastian.pop@cri.ensmp.fr>
  982. * tree-flow.h (walk_use_def_chains_fn): Return a boolean.
  983. True for stopping the use-def walk, false otherwise.
  984. * tree-ssa-alias.c (collect_points_to_info_r): Same.
  985. Always return false, and never stopping the def-use walk as before.
  986. * tree-ssa.c (walk_use_def_chains_1): Stop when the result of the
  987. callback function is true.
  988. * doc/tree-ssa.texi: Document the behavior of the callback
  989. function for walk_use_def_chains.
  990. 2004-02-24 Richard Henderson <rth@redhat.com>
  991. * doc/passes.texi: Rewrite.
  992. 2004-02-23 Diego Novillo <dnovillo@redhat.com>
  993. * Makefile.in (TEXI_GCCINT_FILES): Add cfg.texi and tree-ssa.texi
  994. * tree-ssa-alias.c (compute_may_aliases): Update documentation.
  995. * doc/gccint.texi: Add node for Tree SSA documentation.
  996. Include tree-ssa.texi.
  997. * doc/tree-ssa.texi: New file.
  998. 2004-02-23 Dale Johannesen <dalej@apple.com>
  999. * config/rs6000/rs6000.md: Roll in changes from mainline:
  1000. (movdf_softfloat64): Add POWER form of nop.
  1001. (movsf_hardfloat): Ditto, and accept CTR-to-CTR copy.
  1002. (movdf_hardfloat64): Ditto.
  1003. 2004-02-23 Jeff Law <law@redhat.com>
  1004. * ggc-page.c (struct page_entry): New field PREV.
  1005. (ggc_alloc): Update PREV field appropriately.
  1006. (sweep_pages): Likewise.
  1007. (ggc_free): Likewise. Use PREV field rather than loop to
  1008. improve ggc_free performance.
  1009. * Makefile.in (OBJC-common): Add tree-ssa-copy.o.
  1010. (tree-ssa-copy.o): Add dependencies.
  1011. * tree-flow.h (propagate_value, replace_exp): Prototype.
  1012. (cprop_into_stmt, cprop_into_successor_phis): Likewise.
  1013. * tree-ssa-copy.c: New file, most functions copied from tree-ssa-dom.c
  1014. (cprop_into_stmt): Handle pointer & reference types better.
  1015. * tree-ssa-dom.c (opt_stats_d): Kill uninteresting stats.
  1016. (dump_dominator_optimization_stats): Corresponding changes.
  1017. (cprop_into_stmt): Moved into tree-ssa-copy.c.
  1018. (propagate_value): Likewise.
  1019. (cprop_into_phis): Simplify using code fromi tree-ssa-copy.c.
  1020. (optimize_stmt): Pass additional argument to cprop_into_stmt.
  1021. * tree-ssa-pre.c (generate_expr_as_of_bb): Use replace_exp.
  1022. (generate_vops_as_of_bb): Similarly.
  1023. 2004-02-21 Jan Hubicka <jh@suse.cz>
  1024. * cgraphunit.c (decide_is_function_needed): Nested functions of extern
  1025. inline functions don't need to be output.
  1026. (expand_function): Re-enable sanity check.
  1027. 2004-02-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  1028. * tree-ssa-loop.c (do_while_loop_p): New function.
  1029. (copy_loop_headers): Do not peel do-while loops.
  1030. 2004-02-21 Jan Hubicka <jh@suse.cz>
  1031. * tree-cfg.c (cleanup_control_expr_graph): Update profile.
  1032. * tree-cfg.c (disband_implicit_edges): Set fallthru edges correctly.
  1033. * cfg.c (dump_flow_info): Work on trees too.
  1034. * tree-pretty-print.c (dump_generic_bb_stuff): Do not touch bb
  1035. annotations when not allocated.
  1036. 2004-02-21 Jeff Law <law@redhat.com>
  1037. * tree-ssa-dom.c (cprop_into_stmt): Look at the type's main variant
  1038. to determine if the two operands of a copy have equivalent types.
  1039. 2004-02-20 Jeff Law <law@redhat.com>
  1040. * tree-flow-inline.h (may_propagate_copy): Do not perform ABNORMAL_PHI
  1041. and DECL_HARD_REGISTER tests on virtual operands.
  1042. * tree-flow.h (propagate_copy): Kill prototype.
  1043. (propagate_value): New prototype.
  1044. * tree-ssa-dom.c (propagate_copy): Now static.
  1045. (propagate_value): No longer static.
  1046. 2004-02-20 Richard Henderson <rth@redhat.com>
  1047. PR middle-end/14218
  1048. * c-simplify.c (mark_labels_r): Move to ...
  1049. * gimplify.c (force_labels_r): ... here, and rename.
  1050. (gimplify_init_constructor): Invoke it.
  1051. * tree-simple.h (force_labels_r): Declare.
  1052. 2004-02-20 Richard Henderson <rth@redhat.com>
  1053. PR opt/14194
  1054. * tree-ssa-ccp.c (substitute_and_fold): Also mark new vars
  1055. if fold_stmt was successful.
  1056. 2004-02-20 Diego Novillo <dnovillo@redhat.com>
  1057. * doc/invoke.texi: Add documentation for parameters
  1058. global-var-threshold and max-aliased-vops.
  1059. * params.def (PARAM_GLOBAL_VAR_THRESHOLD): Reformat help message.
  1060. (PARAM_MAX_ALIASED_VOPS): Rename from PARAM_MAX_ALIAS_SET_SIZE.
  1061. * params.h (MAX_ALIASED_VOPS): Rename from MAX_ALIAS_SET_SIZE.
  1062. Update all users.
  1063. * tree-ssa-alias.c (struct alias_map_d): Document fields.
  1064. Add fields total_alias_vops, grouped_p and may_aliases.
  1065. (struct alias_info): Change fields addressable_vars and
  1066. pointers to malloc'd arrays. Update all users.
  1067. Add fields num_references and total_alias_vops.
  1068. (compute_may_aliases): Add more comments.
  1069. (init_alias_info): Initialize new fields in struct alias_info.
  1070. (delete_alias_info): Corresponding changes.
  1071. (compute_points_to_and_addr_escape): Count references to
  1072. potentially aliased variables and pointer dereferences.
  1073. (compute_flow_insensitive_aliasing): Remove old grouping
  1074. heuristic.
  1075. Count the number of virtual operands induced by all the alias
  1076. sets created and call group_aliases if the number exceeds the
  1077. threshold set by --param max-aliased-vops.
  1078. (total_alias_vops_cmp): New.
  1079. (group_aliases_into): New.
  1080. (group_aliases): New.
  1081. * tree-ssa-operands.c (get_expr_operands): Change dump file
  1082. message when no flow-sensitive alias information is available.
  1083. (add_stmt_operand): Reformat comment.
  1084. * tree-ssa.c (init_tree_ssa): Don't call bitmap_clear.
  1085. * tree-simple.c (get_base_decl): Fix typo in comment.
  1086. * tree-pretty-print.c (print_call_name): Handle matrices of
  1087. function pointers.
  1088. 2004-02-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  1089. * Makefile.in (tree-ssa-loop.o): Add tree-inline.h dependency.
  1090. * basic-block.h (struct reorder_block_def): Moved from cfglayout.h.
  1091. (alloc_rbi_pool, initialize_bb_rbi, free_rbi_pool): New.
  1092. * bb-reorder.c (copy_bb): Use cfghooks for bb duplication.
  1093. * cfg.c (rbi_pool): New variable.
  1094. (alloc_rbi_pool, free_rbi_pool, initialize_bb_rbi): New functions.
  1095. * cfghooks.c (can_duplicate_block_p, duplicate_block): New functions.
  1096. * cfghooks.h (struct cfg_hooks): Add can_duplicate_block_p and
  1097. duplicate_block hooks.
  1098. (can_duplicate_block_p, duplicate_block): Declare.
  1099. * cfglayout.c (cfg_layout_pool, cfg_layout_initialize_rbi): Removed.
  1100. (fixup_reorder_chain): Use initialize_bb_rbi.
  1101. (cfg_layout_can_duplicate_bb_p, cfg_layout_duplicate_bb): Hookized.
  1102. (cfg_layout_initialize): Use cfg.c rbi pool manipulation functions.
  1103. (can_copy_bbs_p, copy_bbs): Use cfghooks for bb duplication.
  1104. * cfglayout.h (typedef struct reorder_block_def): Moved to
  1105. basic_block.h.
  1106. (cfg_layout_can_duplicate_bb_p, cfg_layout_duplicate_bb): Declaration
  1107. removed.
  1108. * cfgrtl.c (cfg_layout_create_basic_block): Use initialize_bb_rbi.
  1109. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hook): Fill in can_duplicate_block_p
  1110. and duplicate_block fields.
  1111. * common.opt (ftree-ch): Add.
  1112. * flags.h (flag_tree_ch): Declare.
  1113. * jump.c (next_nonnote_insn_in_loop, duplicate_loop_exit_test,
  1114. copy_loop_headers): Removed.
  1115. * loop-unswitch.c (unswitch_loop): Use cfghooks for bb duplication.
  1116. * opts.c (decode_options): Enable flag_tree_ch at -O1.
  1117. (common_handle_option): Handle -ftree_ch.
  1118. * rtl.h (copy_loop_headers): Declaration removed.
  1119. * timevar.def (TV_TREE_CH): New.
  1120. * toplev.c (flag_tree_ch): New.
  1121. (rest_of_compilation): Do not call copy_loop_headers.
  1122. * tracer.c (tail_duplicate): Use cfghooks for bb duplication.
  1123. * tree-cfg.c (build_tree_cfg): Call alloc_rbi_pool.
  1124. (create_bb): Call initialize_bb_rbi.
  1125. (delete_tree_cfg): Call free_rbi_pool.
  1126. (tree_duplicate_bb): Hookize.
  1127. (tree_can_duplicate_bb_p): New.
  1128. (tree_cfg_hooks): Fill in can_duplicate_block_p and duplicate_block
  1129. fields.
  1130. * tree-flow.h (tree_duplicate_bb): Declaration removed.
  1131. * tree-optimize.c (init_tree_optimization_passes): Add pass_ch.
  1132. * tree-pass.h (pass_ch): Declare.
  1133. * tree-ssa-loop.c: Include tree-inline.h.
  1134. (call_expr_p, should_duplicate_loop_header_p, mark_defs_for_rewrite,
  1135. duplicate_blocks, copy_loop_headers, gate_ch): New functions.
  1136. (pass_ch): New.
  1137. * doc/invoke.texi (-fdump-tree-ch, -ftree-ch): Document.
  1138. 2004-02-19 David Edelsohn <edelsohn@gnu.org>
  1139. * config/rs6000/aix.h (MFWRAP_SPEC): Define.
  1140. (MFLIB_SPEC): Define.
  1141. 2004-02-19 Jeff Law <law@redhat.com>
  1142. * tree-ssa-phiopt.c (tree_ssa_phiopt): TRUTH_NOT_EXPR is valid
  1143. gimple code.
  1144. 2004-02-19 Steven Bosscher <stevenb@suse.de>
  1145. * tree-cfg.c (cleanup_dead_labels): New function to remove
  1146. redundant labels.
  1147. Remove the RTL inliner.
  1148. * calls.c (try_to_integrate): Remove.
  1149. (expand_call): Do not try to expand calls inline.
  1150. * dbxout.c (dbxout_symbol_location): Don't mention integrate.c
  1151. in comments.
  1152. * expmed.c (extract_fixed_bit_field): Always propagate the
  1153. target for the shift if it is a REG.
  1154. * expr.c (emit_move_insn_1): Don't generate inline warnings.
  1155. (expand_expr_real_1): Don't look at inline_function_decl.
  1156. Don't output inlined functions here.
  1157. * expr.h (expand_inline_function): Remove prototype.
  1158. * emit-rtl.c (copy_most_rtx): Don't copy the integrated flag.
  1159. Copy the new return_val flag.
  1160. * final.c (final): Don't look at RTX_INTEGRATED_P.
  1161. * cfgrtl.c (create_basic_block_structure): Likewise.
  1162. * haifa-sched.c (priority): Likewise.
  1163. (restore_line_notes): Likewise.
  1164. * function.c (inline_function_decl): Remove.
  1165. (put_var_into_stack): Don't use it.
  1166. (fix_lexical_addr): Likewise.
  1167. * function.c (inline_function_decl): Remove extern declaration.
  1168. * genattrtab.c (ATTR_PERMANENT_P): Use the return_val flag
  1169. instead of the integrated flag.
  1170. * integrate.c (INTEGRATE_THRESHOLD): Remove.
  1171. (setup_initial_hard_reg_value_integration): Likewise.
  1172. (initialize_for_inline): Likewise.
  1173. (note_modified_parmregs): Likewise.
  1174. (integrate_parm_decls): Likewise.
  1175. (process_reg_param): Likewise.
  1176. (save_parm_insns): Likewise.
  1177. (copy_insn_list): Likewise.
  1178. (copy_insn_notes): Likewise.
  1179. (compare_blocks): Likewise.
  1180. (find_block): Likewise.
  1181. (inlining): Likewise.
  1182. (function_cannot_inline_p): Likewise.
  1183. (parmdecl_map): Likewise.
  1184. (in_nonparam_insns): Likewise.
  1185. (save_for_inline): Likewise.
  1186. (FIXED_BASE_PLUS): Likewise.
  1187. (expand_inline_function): Likewise.
  1188. (copy_rtx_and_substitute): Don't look at map->integrating,
  1189. map->inline_target, and inlining, since we are never copying
  1190. for integrating.
  1191. Don't abort on RTX_INTEGRATED_P.
  1192. (old_fun): Remove.
  1193. (output_inline_function): Remove.
  1194. * integrate.h (struct inline_map): Remove fields integrating,
  1195. block_map, leaf_reg_map, inline_target, and local_return_label.
  1196. * print-rtl.c (print_rtx): Don't print the integrated flag.
  1197. Print the return_val flag.
  1198. * rtl.h (struct rtx_def): Replace the integrated flag with the
  1199. return_val flag.
  1200. (RTX_INTEGRATED_P): Remove.
  1201. (notice_rtl_inlining_of_deferred_constant): Remove prototype.
  1202. * stmt.c (force_label_rtx): Don't look at inline_function_decl.
  1203. * toplev.c (rest_of_handle_inlining): Remove.
  1204. (rest_of_compilation): Don't call it, and never jump to exit.
  1205. Call convert_from_eh_region_ranges.
  1206. (wrapup_global_declarations): Don't output nested inlined functions.
  1207. * tree.h (function_cannot_inline_p): Remove prototype.
  1208. (save_for_inline): Ditto.
  1209. (output_inline_function): Ditto.
  1210. * unroll.c (unroll_loop): Don't clear map->inline_target.
  1211. * varasm.c (notice_rtl_inlining_of_deferred_constant): Remove.
  1212. * system.h: Poison INTEGRATE_THRESHOLD.
  1213. * config/avr/avr.h: Remove define.
  1214. * config/ip2k/ip2k.h: Likewise.
  1215. * unwind-sjlj.c (uw_install_context): Make a proper static inline
  1216. function.
  1217. * doc/rtl.texi: Remove references to the integrated flag.
  1218. * doc/tm.texi: Remove documentation of INTEGRATE_THRESHOLD.
  1219. 2004-02-17 Andrew Macleod <amacleod@redhat.com>
  1220. * tree-ssa-live.c (coalesce_tpa_members): Don't coalesce partitions
  1221. which are not in the same TPA group.
  1222. * tree-ssa.c (rewrite_out_of_ssa): Coalesce via list first.
  1223. 2004-02-17 Brian Booth <bbooth@redhat.com>
  1224. * tree-ssa-ccp.c (substitute_and_fold): Update stmt after
  1225. calling fold_stmt.
  1226. 2004-02-16 Andrew Pinski <pinskia@physics.uc.edu>
  1227. * config/rs6000/rs6000.c (output_function_profiler): Check
  1228. cfun->static_chain_decl instead of current_function_needs_context.
  1229. 2004-02-16 Jeff Law <law@redhat.com>
  1230. * tree-ssa.dse.c (dse_optimize_stmt): Dump info when we delete
  1231. stores.
  1232. * tree-ssa-dse.c: Update comments.
  1233. * Makefile.in (OBJS-common): Add tree-ssa-dse.o
  1234. (tree-ssa-dse.o): Add dependencies.
  1235. * common.opt (ftree-dse): New option.
  1236. * flags.h (flag_tree_dse): New.
  1237. (flag_tree_dom): Fix comments.
  1238. * opts.c (decode_options): Turn on flag_tree_dse.
  1239. (common_handle_option): Handle OPT_ftree_dse.
  1240. * timevar.def (TV_TREE_PHIOPT): Update text.
  1241. (TV_TREE_DSE): New timevar.
  1242. * toplev.c (flag_tree_dse): New.
  1243. (flag_tree_dom): Fix comments.
  1244. (lang_independent_options): Add -ftree-dse.
  1245. * tree-dfa.c (redirect_immediate_use): New function.
  1246. (redirect_immediate_uses): New function.
  1247. * tree-flow.h (stmt_ann_d): Add UID field.
  1248. (redirect_immediate_uses): Declare.
  1249. * tree-optimize.c (init_tree_optimization_passes): Link in DSE pass.
  1250. * tree-pass.h (pass_dse): Declare.
  1251. * tree-ssa-dse.c: New file implementing DSE.
  1252. * doc/invoke.texi: Document new option.
  1253. 2004-02-16 Richard Henderson <rth@redhat.com>
  1254. * tree-nested.c: New file.
  1255. * Makefile.in (OBJS-common, GTFILES, tree-nested.o): Add it.
  1256. * builtin-types.def (BT_FN_VOID_PTR_PTR, BT_FN_VOID_PTR_PTR_PTR): New.
  1257. * builtins.c (expand_builtin_nonlocal_goto): New.
  1258. (expand_builtin_apply): Fix prepare_call_address args.
  1259. (round_trampoline_addr): Move from function.c.
  1260. (expand_builtin_init_trampoline): New.
  1261. (expand_builtin_adjust_trampoline): New.
  1262. (expand_builtin): Invoke them.
  1263. (build_function_call_expr): Add CALL_EXPR chain operand.
  1264. * builtins.def (BUILT_IN_INIT_TRAMPOLINE,
  1265. BUILT_IN_ADJUST_TRAMPOLINE, BUILT_IN_NONLOCAL_GOTO): New.
  1266. * c-decl.c (finish_function): Call lower_nested_functions.
  1267. (c_expand_decl): Don't declare_nonlocal_label.
  1268. * calls.c (prepare_call_address): Replace fndecl arg with a
  1269. precomputed static chain value.
  1270. (expand_call): Precompute the static chain value. Use
  1271. update_nonlocal_goto_save_area.
  1272. * cgraph.c (cgraph_mark_reachable_node): Don't force nested
  1273. functions to be reachable.
  1274. (cgraph_clone_node): Don't abort cloning functions containing
  1275. nested functions.
  1276. * cgraphunit.c (cgraph_assemble_pending_functions): Don't do
  1277. anything special for nested functions.
  1278. (cgraph_mark_functions_to_output): Likewise.
  1279. (cgraph_estimate_growth, cgraph_clone_inlined_nodes): Likewise.
  1280. (cgraph_optimize): Likewise.
  1281. (cgraph_finalize_function): Don't zap DECL_SAVED_INSNS.
  1282. (cgraph_expand_function): Allow functions to not be emitted.
  1283. * defaults.h (TRAMPOLINE_ALIGNMENT): Move from function.c.
  1284. * dwarf2out.c (gen_subprogram_die): Generate DW_AT_static_link.
  1285. * emit-rtl.c (maybe_set_first_label_num): New.
  1286. * explow.c (update_nonlocal_goto_save_area): New.
  1287. (allocate_dynamic_stack_space): Use it.
  1288. * expr.c (expand_expr_real_1) <LABEL_DECL>: Don't force_label_rtx.
  1289. <COND_EXPR>: Ignore the possibility of non-local labels.
  1290. <ADDR_EXPR>: Don't do trampoline_address.
  1291. * expr.h (lookup_static_chain): Remove.
  1292. (prepare_call_address): Update 2nd arg.
  1293. (update_nonlocal_goto_save_area): Declare.
  1294. * final.c (profile_function): Update static chain test.
  1295. * function.c (TRAMPOLINE_ALIGNMENT): Move to defaults.h.
  1296. (trampolines_created): Move to varasm.c.
  1297. (free_after_compilation): Update for removed fields.
  1298. (allocate_struct_function): Likewise.
  1299. (delete_handlers, lookup_static_chain): Remove.
  1300. (fix_lexical_addr): Don't consider non-local variable refs.
  1301. (trampoline_address): Remove.
  1302. (round_trampoline_addr): Move to builtins.c.
  1303. (adjust_trampoline_addr): Remove.
  1304. (expand_function_start): Update for changes to static chain
  1305. and nonlocal goto handling.
  1306. (initial_trampoline): Move to varasm.c.
  1307. (expand_function_end): Don't build trampolines or kill
  1308. unreferenced nonlocal goto labels.
  1309. * function.h (struct function): Remove x_nonlocal_labels,
  1310. x_nonlocal_goto_handler_slots, x_nonlocal_goto_stack_level,
  1311. x_context_display, x_trampoline_list, needs_context.
  1312. Add static_chain_decl, nonlocal_goto_save_area.
  1313. * gimple-low.c (record_vars): Don't record functions.
  1314. * gimplify.c (declare_tmp_vars): Export.
  1315. (create_artificial_label): Set type.
  1316. (gimplify_expr): Don't consider nonlocal gotos.
  1317. * integrate.c (expand_inline_function): Kill lookup_static_chain ref.
  1318. * jump.c (any_uncondjump_p): Reject nonlocal goto.
  1319. * rtl.h (maybe_set_first_label_num): Declare.
  1320. * stmt.c (label_rtx): Set LABEL_PRESERVE_P appropriately.
  1321. (expand_label): Handle DECL_NONLOCAL and FORCED_LABEL.
  1322. (declare_nonlocal_label): Remove.
  1323. (expand_goto): Don't handle nonlocal gotos.
  1324. (expand_nl_handler_label): Remove.
  1325. (expand_nl_goto_receivers): Remove.
  1326. (expand_end_bindings): Don't expand_nl_goto_receivers. Use
  1327. update_nonlocal_goto_save_area.
  1328. * tree-cfg.c (make_edges): Handle abnormal edges out of block
  1329. falling through to EXIT.
  1330. (make_ctrl_stmt_edges): Don't check GOTO_EXPR for nonlocal goto.
  1331. Handle computed goto with no destinations.
  1332. (tree_can_merge_blocks_p): Don't merge blocks with nonlocal labels.
  1333. (remove_useless_stmts_label, stmt_starts_bb_p): Likewise.
  1334. (tree_forwarder_block_p): Likewise.
  1335. (nonlocal_goto_p): Remove.
  1336. (tree_verify_flow_info): Update to match.
  1337. * tree-dump.c (dump_files): Add tree-nested.
  1338. * tree-flow.h (nonlocal_goto_p): Remove.
  1339. * tree-inline.c (setup_one_parameter): Split out from ...
  1340. (initialize_inlined_parameters): ... here. Handle static chain.
  1341. (inline_forbidden_p_1): Update nonlocal goto check.
  1342. (expand_call_inline): Disable mysterious cgraph abort.
  1343. * tree-optimize.c (tree_rest_of_compilation): Save DECL_SAVED_INSNS.
  1344. * tree-pretty-print.c (dump_generic_node): Print static chain
  1345. and nonlocal label.
  1346. * tree-simple.h (declare_tmp_vars): Declare.
  1347. (lower_nested_functions): Declare.
  1348. * tree-ssa-dom.c (propagate_value): Avoid sharing problems.
  1349. * tree-ssa-operands.c (get_expr_operands): Walk static chain
  1350. field of call_expr.
  1351. * tree.def (CALL_EXPR): Add static chain operand.
  1352. * tree.h (NONLOCAL_LABEL): Remove.
  1353. (TDI_nested): New.
  1354. * varasm.c (TRAMPOLINE_ALIGNMENT): Remove.
  1355. (initial_trampoline): Move from function.c.
  1356. (assemble_trampoline_template): Set and return it.
  1357. (trampolines_created): Move from function.c.
  1358. 2004-02-16 Steven Bosscher <stevenb@suse.de>
  1359. * tree-flow.h (cleanup_control_expr_graph): Don't declare here.
  1360. * tree-cfg.c (cleanup_control_expr_graph): Make static.
  1361. (find_edge_taken_cond_expr): Return an edge if the true and false
  1362. edges of a branch lead to the same basic block.
  1363. 2004-02-13 Diego Novillo <dnovillo@redhat.com>
  1364. * tree-phinodes.c (resize_phi_node): Do not use ggc_realloc to
  1365. allocate a new PHI node.
  1366. 2004-02-12 Diego Novillo <dnovillo@redhat.com>
  1367. * tree-flow.h (kill_redundant_phi_nodes): Remove declaration.
  1368. * tree-optimize.c (init_tree_optimization_passes): Add
  1369. pass_redundant_phi after DOM and CCP.
  1370. (execute_todo): Do not call kill_redundant_phi_nodes.
  1371. * tree-pass.h (TODO_redundant_phi): Remove.
  1372. Update all users.
  1373. Adjust values for all the other TODO_* entries.
  1374. (pass_redundant_phi): Declare.
  1375. * tree-ssa.c (replace_immediate_uses): Call mark_new_vars_to_rename
  1376. if a pointer was replaced.
  1377. (kill_redundant_phi_nodes): Make static.
  1378. (pass_redundant_phi): Define.
  1379. 2004-02-12 Dale Johannesen <dalej@apple.com>
  1380. * Makefile.in (OBJS-common): Add rtl-profile.o, tree-profile.o.
  1381. (profile.o): Add tree-flow.h dependency.
  1382. (rtl-profile.o): New rule.
  1383. (tree-profile.o): New rule.
  1384. (GTFILES): Add tree-profile.c, rtl-profile.c.
  1385. * basic-block.h (flow_call_edges_add): Remove.
  1386. * cfganal.c (need_fake_edge_p): Move to cfgrtl.c.
  1387. (flow_call_edges_add): Move to cfgrtl.c.
  1388. * cfghooks.c: (block_ends_with_call_p): New.
  1389. (block_ends_with_condjump_p): New.
  1390. (flow_call_edges_add): New.
  1391. * cfghooks.h: (struct cfg_hooks): add block_ends_with_call_p,
  1392. block_ends_with_condjump_p, flow_call_edges_add.
  1393. (block_ends_with_call_p): New declaration.
  1394. (block_ends_with_condjump_p): New declaration.
  1395. (flow_call_edges_add): New declaration.
  1396. * cfgrtl.c (rtl_block_ends_with_call_p): New.
  1397. (rtl_block_ends_with_condjump_p): New.
  1398. (need_fake_edge_p): Moved from cfganal.c.
  1399. (rtl_flow_call_edges_add): Moved from cfganal.c (flow_call_edges_add).
  1400. (rtl_cfg_hooks): Add rtl_block_ends_with_call_p,
  1401. rtl_block_ends_with_condjump_p, rtl_flow_call_edges_add.
  1402. (cfg_layout_rtl_cfg_hooks): Ditto.
  1403. * common.opt (ftree-based-profiling): New.
  1404. * coverage.c (tree_ctr_tables): New.
  1405. (coverage_counter_alloc): Use it.
  1406. (build_ctr_info_value): Ditto.
  1407. (coverage_counter_ref): Ditto. Rename to rtl_coverage_counter_ref.
  1408. (tree_coverage_counter_ref): New.
  1409. * coverage.h (coverage_counter_ref): Remove declaration.
  1410. (rtl_coverage_counter_ref): New declaration.
  1411. (tree_coverage_counter_ref): New declaration.
  1412. * opts.c (OPT_ftree_based_profiling): New.
  1413. * profile.c: Include cfghooks.h, tree-flow.h.
  1414. (profile_hooks): New.
  1415. (profile_dump_file): New.
  1416. (instrument_edges): Use hooks instead of RTL-specific code.
  1417. (instrument_values): Ditto.
  1418. (get_exec_counts): Ditto.
  1419. (compute_branch_probabilities): Ditto.
  1420. (compute_value_histograms): Ditto.
  1421. (branch_prob): Ditto.
  1422. (find_spanning_tree): Ditto.
  1423. (end_branch_prob): Ditto.
  1424. (gen_edge_profiler): Move to rtl-profile.c (rtl_gen_edge_profiler).
  1425. (gen_interval_profiler): Ditto (rtl_gen_interval_profiler).
  1426. (gen_pow2_profiler): Ditto (rtl_gen_pow2_profiler).
  1427. (gen_one_value_profiler): Ditto (rtl_gen_one_value_profiler).
  1428. (tree_register_profile_hooks): New.
  1429. (rtl_register_profile_hooks): New.
  1430. * rtl-profile.c: New file.
  1431. * rtl.h (init_branch_prob): Move declaration to value-prof.h.
  1432. (end_branch_prob): Ditto.
  1433. (branch_prob): Ditto.
  1434. * toplev.c (flag_tree_based_profiling): New.
  1435. (f_options): Add -ftree-based-profiling.
  1436. (compile_file): Register rtl-based CFG and profiling hooks.
  1437. (rest_of_compilation): Do rtl-based profiling only when
  1438. !flag_tree_based_profiling. Register rtl-based profiling hooks.
  1439. (process_options): Sorry for -ftree-based-profiling plus
  1440. -ftest-coverage or -fprofile-values.
  1441. * toplev.h (flag_tree_based_profiling): New.
  1442. * tree-cfg.c (tree_block_ends_with_call_p): New.
  1443. (tree_block_ends_with_condjump_p): New.
  1444. (need_fake_edge_p): New.
  1445. (tree_flow_call_edges_add): New (largely from flow_call_edges_add
  1446. in cfganal.c).
  1447. (tree_cfg_hooks): Add tree_block_ends_with_call_p,
  1448. tree_block_ends_with_condjump_p, tree_flow_call_edges_add.
  1449. * tree-optimize.c (init_tree_optimization_passes):
  1450. Add pass_tree_profile.
  1451. * tree-pass.h: Ditto.
  1452. * tree-profile.c: New file.
  1453. * value-prof.c (value_prof_hooks): New.
  1454. (find_values_to_profile): Rename to rtl_find_values_to_profile.
  1455. Move rtl-specific bits in from branch_prob.
  1456. (value_profile_transformations): Rename to
  1457. rtl_value_profile_transformations.
  1458. (struct value_prof_hooks): New.
  1459. (rtl_value_prof_hooks): New.
  1460. (rtl_register_value_prof_hooks): New.
  1461. (tree_find_values_to_profile): New stub.
  1462. (tree_value_profile_transformations): New stub.
  1463. (tree_value_prof_hooks): New stub.
  1464. (tree_register_value_prof_hooks): New stub.
  1465. (find_values_to_profile): New.
  1466. (value_profile_transformations): New.
  1467. * value-prof.h: Add multiple inclusion guard.
  1468. (struct histogram_value): Change rtx fields to void *.
  1469. (rtl_register_value_prof_hooks): New declaration.
  1470. (tree_register_value_prof_hooks): New declaration.
  1471. (find_values_to_profile): New declaration.
  1472. (free_profiled_values): New declaration.
  1473. (value_profile_transformations): New declaration.
  1474. (struct profile_hooks): New declaration.
  1475. (init_branch_prob): Declaration moved from rtl.h.
  1476. (branch_prob): Declaration moved from rtl.h.
  1477. (end_branch_prob): Declaration mooved from rtl.h.
  1478. (tree_register_profile_hooks): New declaration.
  1479. (rtl_register_profile_hooks): New declaration.
  1480. (tree_profile_hooks): New declaration.
  1481. (rtl_profile_hooks): New declaration.
  1482. * doc/invoke.texi: Document -ftree-based-profiling.
  1483. 2004-02-12 Jeff Law <law@redhat.com>
  1484. * domwalk.c (walk_dominator_tree): Move statement walking from
  1485. clients into here. Walk statements in forward or backward order
  1486. as requested by the client. Walk either the dominator tree or
  1487. the post-dominator tree as requested by the client.
  1488. * domwalk.h (dom_walk_data): Add two fields to control direction of
  1489. statement walk and dominator vs post-dominator tree walk. Add
  1490. BSI argument to the per-statement callbacks.
  1491. * tree-ssa-dom.c (optimize_stmt): Update prototype so that it can
  1492. be directly used as a callback for the dominator tree walker.
  1493. Update stmts_to_rescan here.
  1494. (tree_ssa_dominator_optimize): Initialize new fields in the dominator
  1495. walker structure. Use optimize_stmt instead of dom_opt_walk_stmts
  1496. for statement callback.
  1497. (dom_opt_walk_stmts): Kill. No longer used.
  1498. * tree-ssa.c (mark_def_sites): Update prototype so that it can be
  1499. called as the per-statement callback. No longer walk statements here.
  1500. (mark_def_sites_initialize_block): New.
  1501. (rewrite_stmt): Update prototype so that it can be called as the
  1502. per-statement callback.
  1503. (rewrite_walk_stmts): Kill. No longer used.
  1504. (rewrite_into_ssa): Initialize new fields in the dominator walker
  1505. structure. Use rewrite_stmt instead of rewrite_walk_stmts. Add
  1506. mark_def_sites_initialize_block callback.
  1507. 2004-02-12 Steven Bosscher <stevenb@suse.de>
  1508. * doc/cfg.texi: New file.
  1509. * doc/ggcint.texi: Include it. Add a new chapter.
  1510. 2004-02-11 Jeff Law <law@redhat.com>
  1511. * Makefile.in (OBJS-common): Add tree-ssa-forwprop.o
  1512. (tree-ssa-forwprop.o): Add dependencies.
  1513. * timevar.def (TV_TREE_FORWPROP): New timevar.
  1514. * tree-optimize.c (init_tree_optimization_passes): Link in
  1515. the forward propagation pass.
  1516. * tree-pass.h (pass_forwprop): Declare.
  1517. * tree-ssa-forwprop.c: New file with forward propagation pass.
  1518. * doc/invoke.texi: Document dump for forward propagation pass.
  1519. 2004-02-11 Andrew MacLeod <amacleod@redhat.com>
  1520. * tree-ssa.c (rewrite_out_of_ssa): Don't use coalesce list until new
  1521. bug resolved.
  1522. 2004-02-11 Andrew MacLeod <amacleod@redhat.com>
  1523. * tree-ssa-live.c (compare_pairs): New. Coalesce list cost function.
  1524. (sort_coalesce_list): Use qsort() to sort list by cost.
  1525. (coalesce_tpa_members): Use correct partition representatives. Add more
  1526. debug information. Allow coalesce by list, root_var, or both.
  1527. (tpa_dump): Show partition index.
  1528. * tree-ssa-live.h (SSANORM_COALESCE_PARTITIONS): New flag.
  1529. (SSANORM_USE_COALESCE_LIST): New flag.
  1530. * tree-ssa.c (create_temp): Don't mark as used when created.
  1531. (coalesce_ssa_name): Create coalesce list if requested. Add more
  1532. debug output.
  1533. (assign_vars): Add additional debug info.
  1534. (remove_ssa_form): Perform TER after assign_vars().
  1535. (rewrite_vars_out_of_ssa): Pass coalesce partitions flag to
  1536. remove_ssa_form.
  1537. (rewrite_out_of_ssa): Add coalesce list flag to remove_ssa_form call.
  1538. 2004-02-10 Jeff Law <law@redhat.com>
  1539. * Makefile.in (OBJS-common): Add tree-ssa-phiopt.o
  1540. (tree-ssa-phiopt.o): Add dependencies.
  1541. * timevar.def (TV_TREE_PHIOPT): New timevar.
  1542. * tree-cfg.c (extract_true_false_edges_from_block): Moved here from
  1543. tree-ssa-dom.c.
  1544. (tree_verify_flow_info): Use extract_true_false_edges_from_block.
  1545. * tree-flow.h (extract_true_false_edges_from_block): Declare.
  1546. * tree-ssa-dom.c (extract_true_false_edges_from_block): Moved into
  1547. tree-cfg.c.
  1548. (get_eq_expr_value): Improve type check.
  1549. * tree-optimize.c (init_tree_optimization_passes): Link in
  1550. phiopt pass.
  1551. * tree-pass.h (pass_phiopt): Declare.
  1552. * tree-ssa-phiopt.c: New file with PHI node optimization pass.
  1553. * doc/invoke.texi: Document dump for PHI node optimization.
  1554. 2004-02-10 Richard Henderson <rth@redhat.com>
  1555. * tree-sra.c (lookup_scalar): Handle unnamed fields.
  1556. 2004-02-10 Diego Novillo <dnovillo@redhat.com>
  1557. * Makefile.in (OBJS-common): Add tree-ssa-alias.o.
  1558. (tree-ssa-alias.o): New rule.
  1559. (tree-ssa-operands.o): Add dependency on $(TIMEVAR_H) and tree-pass.h
  1560. (gt-tree-dfa.h): Remove.
  1561. * timevar.def (TV_TREE_OPS): Rename from unused entry TV_TREE_DFA.
  1562. * tree-ssa-alias.c: New file.
  1563. * tree-dfa.c (struct alias_stats_d, alias_stats, dump_alias_stats,
  1564. may_alias_p, add_may_alias, global_var, aliases_computed_p,
  1565. compute_may_aliases): Move to tree-ssa-alias.c.
  1566. (struct walk_state): Remove fields 'is_asm_expr' and 'num_calls'.
  1567. Update all users.
  1568. (compute_alias_sets, create_memory_tags, may_access_global_mem_p,
  1569. get_memory_tag_for, promote_call_clobbered_vars,
  1570. find_addressable_vars): Remove.
  1571. (call_clobbered_vars): Move to tree-ssa-alias.c and convert to
  1572. bitmap.
  1573. (find_referenced_vars): Move logic to create .GLOBAL_VAR to
  1574. tree-ssa-alias.c.
  1575. (create_ssa_name_ann): New.
  1576. (dump_variable): Rearrange.
  1577. (dump_dfa_stats): Do not show the number of call clobbered
  1578. variables.
  1579. (find_vars_r): Do not try to determine if an assignment my access
  1580. global memory.
  1581. (add_referenced_var): Remove hacks to establish global memory
  1582. dependencies.
  1583. If the variable needs to live in memory mark it call-clobbered.
  1584. * tree-flow-inline.h (ssa_name_ann): New.
  1585. (get_ssa_name_ann): New.
  1586. (set_may_alias_global_mem): Remove.
  1587. (may_alias_global_mem_p): Remove.
  1588. (set_may_point_to_global_mem): Remove.
  1589. (may_point_to_global_mem_p): Remove.
  1590. (is_call_clobbered): New
  1591. (mark_call_clobbered): New
  1592. (mark_non_addressable): New
  1593. * tree-flow.h (enum tree_ann_type): Add SSA_NAME_ANN.
  1594. (enum mem_tag_kind): Declare.
  1595. (struct var_ann_d): Remove fields 'is_call_clobbered',
  1596. 'may_alias_global_mem' and 'may_point_to_global_mem'.
  1597. Replace bitfield 'mem_tag' with enum bitfield 'mem_tag_kind'.
  1598. Rename field 'mem_tag' to 'type_mem_tag'.
  1599. (struct stmt_ann_d): Change type of field 'addresses_taken' to a
  1600. bitmap. Update all users.
  1601. (struct ssa_name_ann_d): Declare.
  1602. (union tree_ann_d): Add field 'ssa_name'.
  1603. (ssa_name_ann_t): New type.
  1604. (struct bb_ann_d): Add field 'has_escape_site'.
  1605. (num_call_clobbered_vars): Remove.
  1606. (call_clobbered_var): Remove.
  1607. (call_clobbered_vars): Change to bitmap.
  1608. (dump_points_to_info): Declare.
  1609. (debug_points_to_info): Declare.
  1610. (walk_use_def_chains_fn): New type.
  1611. (walk_use_def_chains): Declare.
  1612. (is_call_clobbered): Declare.
  1613. (mark_call_clobbered): Declare.
  1614. * tree-simple.c (needs_to_live_in_memory): Move to tree.c.
  1615. (is_gimple_non_addressable): Update comment.
  1616. (is_gimple_call_clobbered): Remove.
  1617. (get_call_expr_in): New.
  1618. (get_base_var): Rename from get_base_symbol. Update all callers.
  1619. Don't strip SSA_NAME wrappers.
  1620. (get_base_decl): New.
  1621. (get_base_address): New.
  1622. * tree-simple.h (is_gimple_call_clobbered): Remove.
  1623. (needs_to_live_in_memory): Remove.
  1624. (get_base_decl): Declare.
  1625. (get_base_var): Declare.
  1626. (get_base_address): Declare.
  1627. * tree-ssa-dce.c (need_to_preserve_store): Reduce to calling
  1628. needs_to_live_in_memory.
  1629. * tree-ssa-operands.c: Include tree-pass.h and timevar.h
  1630. (get_stmt_operands): Push/pop TV_TREE_OPS time var.
  1631. Call mark_call_clobbered for asms that store to memory.
  1632. (get_expr_operands): When adding operands for INDIRECT_REF
  1633. expressions, use flow-sensitive aliasing, if available.
  1634. Assume that malloc-like function calls won't clobber.
  1635. (add_call_clobber_ops):
  1636. (add_call_read_ops):
  1637. * tree-ssa.c (rewrite_into_ssa): If any variable in vars_to_rename
  1638. is a pointer, invalidate all name memory tags.
  1639. (create_temp): Call is_call_clobbered and mark_call_clobbered.
  1640. (walk_use_def_chains_1): New.
  1641. (walk_use_def_chains): New.
  1642. * tree.c (needs_to_live_in_memory): New.
  1643. * tree.h (DECL_NEEDS_TO_LIVE_IN_MEMORY_INTERNAL): Define.
  1644. (struct tree_decl): Add bitfield 'needs_to_live_in_memory'.
  1645. Update unused bits comment.
  1646. (needs_to_live_in_memory): Declare.
  1647. * tree-simple.h (get_call_expr_in): Declare.
  1648. * tree-sra.c (scalarize_stmt): Call get_call_expr_in when handling
  1649. function calls.
  1650. * tree-ssa-ccp.c (likely_value): Likewise.
  1651. * params.def (PARAM_MAX_CLOBBERED_VARS_GLOBAL_VAR): Remove.
  1652. (PARAM_MAX_CALLS_GLOBAL_VAR): Remove.
  1653. (PARAM_GLOBAL_VAR_THRESHOLD): Define.
  1654. (PARAM_MAX_ALIAS_SET_SIZE): Define.
  1655. Update all users.
  1656. * params.h (MAX_CALLS_FOR_GLOBAL_VAR): Remove.
  1657. (MAX_CLOBBERED_VARS_FOR_GLOBAL_VAR): Remove.
  1658. (GLOBAL_VAR_THRESHOLD): Define.
  1659. (MAX_ALIAS_SET_SIZE): Define.
  1660. 2004-02-09 Richard Henderson <rth@redhat.com>
  1661. * langhooks.h (lang_hooks_for_functions): Add missing_noreturn_ok_p.
  1662. * langhooks-def.h, c-lang.c, objc/objc-lang.c
  1663. (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): New.
  1664. * c-objc-common.c (c_missing_noreturn_ok_p): Return bool.
  1665. (c_objc_common_init): Don't set lang_missing_noreturn_ok_p.
  1666. * c-tree.h (c_missing_noreturn_ok_p): Update decl.
  1667. * flow.c (lang_missing_noreturn_ok_p): Remove.
  1668. * flow.c (check_function_return_warnings): Move to tree-cfg.c.
  1669. * toplev.c (rest_of_compilation): Don't call it.
  1670. * tree-cfg.c (execute_warn_function_return): Move from flow.c,
  1671. rename, update for tree vs rtl.
  1672. (pass_warn_function_return): New.
  1673. * tree-pass.h (pass_warn_function_return): Declare it.
  1674. * tree-optimize.c (init_tree_optimization_passes): Run it.
  1675. * function.h (struct function): Remove x_clobber_return_insn.
  1676. * function.c (free_after_compilation): Don't set it.
  1677. (expand_function_end): Likewise.
  1678. 2004-02-09 Richard Henderson <rth@redhat.com>
  1679. Revert:
  1680. 2004-02-06 Richard Henderson <rth@redhat.com>
  1681. * tree-ssa-dom.c (record_equivalences_from_phis): Use
  1682. record_const_or_copy.
  1683. (record_equivalences_from_stmt): Likewise. Replace
  1684. block_avail_exprs_p and block_nonzero_vars_p args with bd.
  1685. 2004-02-09 Jeff Law <law@redhat.com>
  1686. * tree-ssa-dom.c (get_eq_expr_value): Improve handling of boolean
  1687. conditions.
  1688. * domwalk.c (walk_dominator_tree): Completely lose PARENT argument.
  1689. Callers updated. No longer pass PARENT to callbacks.
  1690. * domwalk.h (struct dom_walk_data): Corresponding changes.
  1691. * tree-ssa-dom.c: Likewise.
  1692. * tree-ssa.c: Likewise.
  1693. * domwalk.c (walk_dominator_tree): Change last argument to be the
  1694. parent block in the dominator tree rather than the last statement
  1695. in the parent block in the dominator tree. Similarly in all the
  1696. callbacks.
  1697. * domwalk.h (struct dom_walk_data): Update callback prototypes.
  1698. * tree-ssa-dom.c: Corresponding changes.
  1699. * tree-ssa.c: Likewise.
  1700. * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Break out
  1701. of tree_ssa_dominator_optimize. If the out-of-ssa pass creates
  1702. new variables, then invalidate some requested jump threads.
  1703. 2004-02-08 Richard Henderson <rth@redhat.com>
  1704. * flow.c (regno_uninitialized): Remove.
  1705. * output.h (regno_uninitialized): Remove.
  1706. * function.c (setjmp_vars_warning): Rename from
  1707. uninitialized_vars_warning, remove uninitialized vars warning.
  1708. * toplev.c (rest_of_handle_life): Update to match.
  1709. * tree.h (setjmp_vars_warning): Likewise.
  1710. * tree-sra.c (lookup_scalar): Set DECL_NAME to something descriptive.
  1711. * tree-ssa.c (warn_uninit): New.
  1712. (warn_uninitialized_var, warn_uninitialized_phi): New.
  1713. (execute_early_warn_uninitialized): New.
  1714. (execute_late_warn_uninitialized): New.
  1715. (gate_warn_uninitialized): New.
  1716. (pass_early_warn_uninitialized): New.
  1717. (pass_late_warn_uninitialized): New.
  1718. * tree-pass.h (pass_early_warn_uninitialized): New.
  1719. (pass_late_warn_uninitialized): New.
  1720. * tree-optimize.c (init_tree_optimization_passes): Add them.
  1721. 2004-02-08 Richard Henderson <rth@redhat.com>
  1722. * cppexp.c (append_digit): Rearrange unsignedp/overflow setting.
  1723. (eval_token, num_binary_op, num_part_mul, num_div_op): Likewise.
  1724. * ra-rewrite.c (rewrite_program2): Zero info.
  1725. * reload.c (decompose): Zero val.
  1726. * tree-ssa-ccp.c (visit_phi_node): Zero phi_val.const_val.
  1727. 2004-02-07 Jan Hubicka <jh@suse.cz>
  1728. * tree-inline.c (save_body): Clone the parm decl correctly.
  1729. * cgraph.c: Add introductionary comment.
  1730. (cgraph_remove_node): Release DECL_SAVED_INSNS too.
  1731. * cgraphunit.c: Likewise.
  1732. (cgraph_finalize_function): Release DECL_SAVED_INSNS of external function.
  1733. (decl_expand_function): Release DECL_SAVED_INSNS/body/tree.
  1734. (cgraph_remove_unreachable_nodes): Likewise; guard cgraph verification.
  1735. 2004-02-06 Richard Henderson <rth@redhat.com>
  1736. * common.opt (fdisable-tree-ssa): Remove.
  1737. * flags.h (flag_disable_tree_ssa): Remove.
  1738. * toplev.c (flag_disable_tree_ssa): Remove.
  1739. (f_options): Don't set it.
  1740. * opts.c (common_handle_option): Likewise.
  1741. * doc/invoke.texi (fdisable-tree-ssa): Remove.
  1742. 2004-02-06 Richard Henderson <rth@redhat.com>
  1743. * tree-ssa-dom.c (record_equivalences_from_phis): Use
  1744. record_const_or_copy.
  1745. (record_equivalences_from_stmt): Likewise. Replace
  1746. block_avail_exprs_p and block_nonzero_vars_p args with bd.
  1747. 2004-02-06 Andrew Pinski <pinskia@physics.uc.edu>
  1748. PR middle-end/13127
  1749. * tree-inline.c (declare_return_variable): Set the no warning bit
  1750. on the variable created for the return value.
  1751. 2004-02-06 Richard Henderson <rth@redhat.com>
  1752. * tree-pretty-print.c (dump_generic_node): Render NON_LVALUE_EXPR.
  1753. * tree-ssa-dom.c (local_fold): New.
  1754. (thread_across_edge, simplify_rhs_and_lookup_avail_expr,
  1755. find_equivalent_equality_comparison): Use it.
  1756. 2004-02-06 Andrew Pinski <pinskia@physics.uc.edu>
  1757. PR c/13863
  1758. * c-common.c (c_decl_uninit_1): Remove.
  1759. (c_decl_uninit): Remove.
  1760. * c-common.h (c_decl_uninit): Remove prototype.
  1761. * c-lang.c (LANG_HOOKS_DECL_UNINIT): Delete.
  1762. * objc/objc-lang.c (LANG_HOOKS_DECL_UNINIT): Delete.
  1763. * c-simplify.c (gimplify_decl_stmt): Set TREE_NO_WARNING
  1764. on the decl where the initial is itself.
  1765. * function.c (uninitialized_vars_warning): Remove old comment
  1766. and check for DECL_INITIAL, replace with a check of TREE_NO_WARNING
  1767. and do not call the langhook.
  1768. * langhooks-def.h (LANG_HOOKS_DECL_UNINIT): Remove.
  1769. (LANG_HOOKS_INITIALIZER): Remove usage of LANG_HOOKS_DECL_UNINIT.
  1770. * langhooks.c (lhd_decl_uninit): Remove.
  1771. * langhooks.h (lhd_decl_uninit): Remove prototype.
  1772. 2004-02-05 Richard Henderson <rth@redhat.com>
  1773. * tree-ssa-dom.c (record_const_or_copy_1): New.
  1774. (record_const_or_copy): New.
  1775. (thread_across_edge): Use it.
  1776. (dom_opt_finalize_block): Likewise. Tidy.
  1777. (record_equality): Split out from ...
  1778. (record_equivalences_from_incoming_edge): ... here.
  1779. 2004-02-05 Richard Henderson <rth@redhat.com>
  1780. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Allow
  1781. mixing PLUS and MINUS when folding operations.
  1782. 2004-02-05 Andrew Macleod <amacleod@redhat.com>
  1783. * tree-pretty-print.c (dump_bb_header): Allow TDF_SLIM printing.
  1784. (dump_bb_end): Allow TDF_SLIM printing.
  1785. (dump_generic_bb_buff): Add flags parameter to dump_bb_end.
  1786. 2004-02-05 Jan Hubicka <jh@suse.cz>
  1787. * alias.c (find_base_term, get_addr): Do not dereference NULL
  1788. pointer when all VALUE's locations has been invalidated.
  1789. (rtx_equal_for_memref_p): Simplify checking of VALUEs.
  1790. 2004-02-04 Daniel Berlin <dberlin@dberlin.org>
  1791. * tree-alias-ander.c (andersen_init): Reorder/Redo code so that we
  1792. actually free the memory in intraprocedural mode.
  1793. (andersen_cleanup): Ditto.
  1794. 2004-02-04 Richard Henderson <rth@redhat.com>
  1795. * tree-ssa-ccp.c (get_value, visit_phi_node,
  1796. visit_assignment, dump_lattice_value): Tidy.
  1797. (evaluate_stmt): Don't do debug dump here.
  1798. (def_to_undefined): Merge into set_lattice_value.
  1799. (def_to_varying): Likewise, but retain as a wrapper.
  1800. (set_lattice_value): Tidy. Emit correct debug info.
  1801. (replace_uses_in): Remove strlen hacks.
  1802. (execute_fold_all_builtins): Fix DECL_BUILT_IN comparison.
  1803. Force folding of BUILT_IN_CONSTANT_P.
  1804. 2004-02-04 Richard Henderson <rth@redhat.com>
  1805. * builtins.c (fold_builtin_expect): New.
  1806. (fold_builtin_1): Call it.
  1807. 2004-02-04 Jeff Law <law@redhat.com>
  1808. * jump.c (duplicate_loop_exit_test): Allow copying of the loop
  1809. exit test even if we do not find the LOOP_END note.
  1810. * domwalk.c: Update comments.
  1811. 2004-02-04 Brian Booth <bbooth@redhat.com>
  1812. PR opt/13755
  1813. * tree-dfa.c (compute_alias_sets): set rename flag for variables
  1814. aliased by GLOBAL_VAR.
  1815. 2004-02-04 Richard Henderson <rth@redhat.com>
  1816. * tree-ssa-dom.c (simplify_switch_and_lookup_avail_expr): New.
  1817. (eliminate_redundant_computations): Call it.
  1818. 2004-02-03 Richard Henderson <rth@redhat.com>
  1819. PR opt/13869
  1820. * tree-cfg.c (cfg_remove_useless_stmts_bb): Correct handling of
  1821. boolean variables in COND_EXPR_COND.
  1822. 2004-02-03 Richard Henderson <rth@redhat.com>
  1823. PR middle-end/13325
  1824. * builtins.c (fold_builtin_1): Rename from fold_builtin.
  1825. (fold_builtin): New.
  1826. * c-simplify.c (gimplify_expr_stmt): Check TREE_NO_WARNING.
  1827. * stmt.c (expand_expr_stmt_value): Likewise.
  1828. * tree.h (struct tree_common): Add nowarning_flag.
  1829. (TREE_NO_WARNING): New.
  1830. (TREE_NO_UNUSED_WARNING): Remove.
  1831. * c-typeck.c (build_unary_op): Use TREE_NO_WARNING instead.
  1832. * stmt.c (warn_if_unused_value): Likewise.
  1833. 2004-02-03 Steven Bosscher <stevenb@suse.de>
  1834. * tree-ssa-dce.c: Partial rewrite. The old DCE is now called
  1835. `conservative'. The more aggressive algorithm uses control
  1836. dependence and is called `aggressive' or cd-dce.
  1837. * timevar.def (TV_TREE_DCE): Rename.
  1838. (TV_TREE_CD_DCE, TV_CONTROL_DEPENDENCES): New timevars.
  1839. * tree-pass.h: Declare extern pass_cd_dce.
  1840. * tree-optimize.c (init_tree_optimization_passes): Replace
  1841. the final DCE pass with a CD-DCE pass.
  1842. 2004-02-01 Jan Hubicka <jh@suse.cz>
  1843. * cgraphunit.c (cgraph_mark_inline_edge): Fix insertion to
  1844. cgraph_inline_hash.
  1845. 2004-01-30 Frank Ch. Eigler <fche@redhat.com>
  1846. * common.opt: Add support for -fmudflapth, -fmudflapir.
  1847. * invoke.texi: Document them.
  1848. * opts.c: Ditto.
  1849. * flags.h: Add new flags flag_mudflap_threads, _ignore_reads.
  1850. * toplev.c: Initialize new flags. Remove redundant code from
  1851. lang_independent_options[].
  1852. * tree-mudflap.c (*): Support new flag_mudflap_threads encoding.
  1853. (mf_xform_derefs_1): Support flag_mudflap_ignore_reads option.
  1854. * c-mudflap.c (mflang_flush_calls): Mark static ctor TREE_USED.
  1855. 2004-01-30 Ian Lance Taylor <ian@wasabisystems.com>
  1856. * gengtype-yacc.y (bitfieldlen): Add empty action.
  1857. 2004-01-30 Diego Novillo <dnovillo@redhat.com>
  1858. * configure.ac: Move configuration for libbanshee and
  1859. libgmp from configure.in.
  1860. 2004-01-30 Richard Henderson <rth@redhat.com>
  1861. PR opt/13524
  1862. * gengtype-yacc.y (struct_fields): Accept unnamed bitfields.
  1863. (bitfieldlen): Split from ...
  1864. (bitfieldopt): ... here.
  1865. * gimplify.c (mark_not_gimple): Remove.
  1866. (gimplify_call_expr): Don't ignore BUILT_IN_MD.
  1867. * tree-dfa.c (struct walk_state): Remove is_not_gimple.
  1868. (find_referenced_vars): Don't look for TREE_NOT_GIMPLE.
  1869. (find_vars_r, add_referenced_var): Likewise.
  1870. * tree-ssa-operands.c (get_stmt_operands, get_expr_operands): Likewise.
  1871. * tree-simple.h (mark_not_gimple): Remove.
  1872. * tree.h (struct tree_common): Remove not_gimple_flag.
  1873. (TREE_NOT_GIMPLE): Remove.
  1874. 2004-01-29 Jason Merrill <jason@redhat.com>
  1875. PR c++/13865
  1876. * c-simplify.c (gimplify_for_stmt): Reorganize to fix cleanups.
  1877. 2004-01-29 Richard Henderson <rth@redhat.com>
  1878. PR c++/13543
  1879. * tree-inline.c (initialize_inlined_parameters): Register the
  1880. substitute reference also.
  1881. 2004-01-29 Richard Henderson <rth@redhat.com>
  1882. * tree-inline.c (gimple_expand_calls_inline): Look inside
  1883. RETURN_EXPR.
  1884. * tree-pretty-print.c (dump_generic_node): If TDF_DETAILS, dump
  1885. both name and uid.
  1886. 2004-01-29 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  1887. * cfg.c (unlink_block): Reset prev_bb and next_bb.
  1888. 2004-01-29 Jeff Law <law@redhat.com>
  1889. Andrew MacLeod <amacleod@redhat.com>
  1890. * tree-ssa-live.h (tpa_next_partition): Correctly handle compressed
  1891. elements.
  1892. * tree-ssa.c (coalesce_ssa_name): New argument, flags. Callers
  1893. updated. Test SSANORM_COMBINE_TEMPS in flags rather than
  1894. flag_tree_combine_temps.
  1895. (coalesce_vars): Either operand of a copy might not have a
  1896. partition when rewriting a subset of the variables out of SSA form.
  1897. (rewrite_vars_out_of_ssa): Honor -ftree-combine-temps by passing
  1898. in SSANORM_COMBINE_TEMPS in flags argument to remove_sas_form..
  1899. 2004-01-29 Dale Johannesen <dalej@apple.com>
  1900. * Makefile.in (OBJS-common): Move tree-nomudflap.o...
  1901. (OBJS-archive): ...to here, and remove duplicate tree-optimize.o.
  1902. 2004-01-28 Richard Henderson <rth@redhat.com>
  1903. PR middle-end/13898
  1904. * gimplify.c (gimplify_init_constructor): Invoke
  1905. lhd_set_decl_assembler_name on the now-static variable.
  1906. 2004-01-28 Richard Henderson <rth@redhat.com>
  1907. PR opt/13798
  1908. * expr.c (is_zeros_p): Remove. Change all callers to use
  1909. initializer_zerop.
  1910. (categorize_ctor_elements_1, categorize_ctor_elements): New.
  1911. (count_type_elements): New.
  1912. (mostly_zeros_p): Use them.
  1913. * gimplify.c (tmp_var_id_num): Split out from create_tmp_var_raw.
  1914. (create_tmp_var_name): Likewise.
  1915. (gimplify_init_constructor): Drop constructors to readonly memory
  1916. as indicated by categorize_ctor_elements and can_move_by_pieces.
  1917. * tree.c (initializer_zerop): Handle VECTOR_CST. Don't check
  1918. AGGREGATE_TYPE_P for CONSTRUCTOR.
  1919. * tree.h (categorize_ctor_elements): Declare.
  1920. (count_type_elements): Declare.
  1921. * Makefile.in (gimplify.o): Update dependencies.
  1922. (GTFILES): Add gimplify.c.
  1923. 2004-01-27 Frank Ch. Eigler <fche@redhat.com>
  1924. * tree-mudflap.c (mx_register_decls): Support VLAs.
  1925. (mf_xform_derefs_1): Disable checking shortcut for VLAs.
  1926. * c-simplify.c (gimplify_decl_stmt): Add mudflap xref comment.
  1927. * gimplify.c (gimplify_bind_expr): Ditto.
  1928. 2004-01-27 Daniel Berlin <dberlin@dberlin.org>
  1929. * tree-ssa-pre.c: Add more comments describing SSAPRE and
  1930. the various functions.
  1931. (generate_expr_as_of_bb): Use PRED, a basic block argument, instead of
  1932. j, the index of that bb.
  1933. (generate_vops_as_of_bb): Ditto.
  1934. (insert_occ_in_preorder_dt_order): Rename to
  1935. create_and_insert_occ_in_preorder_dt_order.
  1936. 2004-01-27 Daniel Berlin <dberlin@dberlin.org>
  1937. * tree-ssa-pre.c (rename_1): Add some more comments.
  1938. 2004-01-25 Andrew Pinski <pinskia@physics.uc.edu>
  1939. PR c/13748
  1940. * c-decl.c (finish_function): Do not pass
  1941. the function on to optimizers if there was an error.
  1942. 2004-01-23 Richard Henderson <rth@redhat.com>
  1943. PR opt/12941
  1944. * combine.c (SHIFT_COUNT_TRUNCATED): Provide default value.
  1945. (simplify_comparison): Don't simplify (eq (zero_extract c 1 r) 0)
  1946. if SHIFT_COUNT_TRUNCATED is set.
  1947. 2004-01-21 Richard Henderson <rth@redhat.com>
  1948. PR c/11267
  1949. * c-decl.c (c_finalize): New.
  1950. (finish_function): Use it. Genericize and finalize only non-nested
  1951. functions. Register nested functions with cgraph.
  1952. * c-simplify.c: Include cgraph.h.
  1953. (c_genericize): Genericize nested functions.
  1954. * gimplify.c (gimplify_expr): Use DECL_SAVED_INSNS to access
  1955. the struct function for the context.
  1956. * Makefile.in (c-simplify.o): Update dependencies.
  1957. 2004-01-21 Steven Bosscher <stevenb@suse.de>
  1958. PR opt/13767
  1959. * tree-cfg.c (simple_goto_p): Remove NONLOCAL_LABEL check.
  1960. 2004-01-21 Dale Johannesen <dalej@apple.com>
  1961. * tree-dfa.c: Fix comment.
  1962. 2004-01-21 Richard Henderson <rth@redhat.com>
  1963. PR opt/13681
  1964. * tree-ssa-operands.c (get_expr_operands): Handle (&x + c).
  1965. * tree-ssa-ccp.c (maybe_fold_offset_to_component_ref): Handle
  1966. flexible array members and lookalikes.
  1967. 2004-01-21 Dale Johannesen <dalej@apple.com>
  1968. * tree-ssa-dom.c (cprop_into_stmt): Add convert call
  1969. to prevent type mismatches.
  1970. 2004-01-21 Daniel Berlin <dberlin@dberlin.org>
  1971. * tree-ssa-pre.c (load_modified_phi_result): PARM_DECL is okay
  1972. to not have a defbb.
  1973. (rename_1): Add a comment.
  1974. 2004-01-21 Jeff Law <law@redhat.com>
  1975. * tree-ssa-dom.c (find_equivalent_equality_comparison): Treat
  1976. CONVERT_EXPRs just like NOP_EXPRs.
  1977. (record_equivalences_from_stmt): Similarly.
  1978. (thread_across_edge): Fix formatting goof.
  1979. * tree-ssa-dom.c (thread_across_edge): Remove bogus restriction
  1980. which prevents threading around to the top of a loop.
  1981. * tree-ssa-dom.c (thread_across_edge): Handle SWITCH_EXPRs in the
  1982. target block in addition to COND_EXPRs.
  1983. * tree-ssa-dom.c (thread_across_edge): Create equivalences for
  1984. PHIs before looking at the statements in the destination
  1985. block.
  1986. 2004-01-20 Roger Sayle <roger@eyesopen.com>
  1987. * fold-const.c (fold_convert): Rename to fold_convert_const.
  1988. (fold_convert_const): Change arguments to take a tree_code,
  1989. a type and the operand/expression to be converted. Return
  1990. NULL_TREE if no simplification is possible. Add support for
  1991. FIX_CEIL_EXPR and FIX_FLOOR_EXPR in addition to FIX_TRUNC_EXPR.
  1992. (fold): Handle FIX_CEIL_EXPR and FIX_FLOOR_EXPR.
  1993. Adjust call to fold_convert to match new fold_convert_const.
  1994. Avoid modifying the tree passed to fold in-place.
  1995. (nondestructive_fold_unary_to_constant): Likewise, simplify
  1996. call to fold_convert to match new fold_convert_const.
  1997. 2004-01-20 Daniel Berlin <dberlin@dberlin.org>
  1998. * tree-alias-ander.c (andersen_op_assign): Update
  1999. prototype. Make this handle &x in the operands using
  2000. the addrargs parameter.
  2001. (andersen_init): Turn off ip_partial until variables
  2002. aliasing variables in other functions is resolved.
  2003. (andersen_add_var): Use newly renamed alias_var_new_with_aterm.
  2004. Fix comment.
  2005. (andersen_add_var_same): Ditto.
  2006. (andersen_function_call): Use ip_partial, not flag_unit_at_a_time.
  2007. * tree-alias-common.c (get_values_from_constructor): Add bitmap
  2008. and int * arguments. Used to mark operands that we are taking
  2009. address of.
  2010. (get_alias_var_decl): We should never see FIELD_DECL's right now.
  2011. (intra_function_call): Reverse ordering for slightly faster
  2012. projection merging.
  2013. (find_op_of_decl): New function.
  2014. (find_func_aliases): Use it.
  2015. Comment x = foo.y case.
  2016. Move get_alias_var_decl of arguments so we only call it if
  2017. necessary.
  2018. Handle address of arguments in operations.
  2019. (create_fun_alias_var): tvar->var.
  2020. Set context of fakeargs.
  2021. Set context of fakedecls.
  2022. Set DECL_PTA_ALIASVAR of RETURN_DECL's.
  2023. (create_fun_alias_var_ptf): tvar->var.
  2024. Set context of fakedecls.
  2025. (create_alias_vars): Only create alias vars for globals
  2026. with DECL_INITIAL's.
  2027. * tree-alias-common.h (struct tree_alias_ops):
  2028. Update op_assign arguments.
  2029. (may_alias): Fix comment.
  2030. (same_points_to_set): Ditto.
  2031. (empty_points_to_set): Ditto.
  2032. * tree-alias-type.h: Rename alias_tvar_new_with_aterm
  2033. -> alias_var_new_with_aterm.
  2034. * tree-alias-type.c: Ditto.
  2035. 2004-01-20 Richard Henderson <rth@redhat.com>
  2036. * tree-sra.c (get_scalar_for_field): Validate field.
  2037. (create_scalar_copies): Iterate over rhs fields too.
  2038. 2004-01-19 Dale Johannesen <dalej@apple.com>
  2039. * params.def: Add PARAM_MAX_CALLS_GLOBAL_VAR and
  2040. PARAM_MAX_CLOBBERED_VARS_GLOBAL_VAR.
  2041. params.h: Ditto.
  2042. tree-dfa.c: Use them.
  2043. doc/invoke.texi: Document them.
  2044. 2004-01-19 Jeff Law <law@redhat.com>
  2045. * tree-ssa.c (insert_phi_nodes_for): Always use fully pruned
  2046. SSA form.
  2047. * tree-flow.h: Update copyright dates.
  2048. (register_new_def): Declare.
  2049. * tree-ssa-dom.c: Update copyright dates.
  2050. Add tracking of current definition of each program variable just
  2051. like we do when rewriting into SSA form.
  2052. (get_value_for, set_value_for): Handle either an SSA_NAME or
  2053. regular variable.
  2054. (tree_ssa_dominator_optimize): Initialize and update CURRDEFS.
  2055. If we thread through a block with real statements, the destination
  2056. of those statements must be rewritten too.
  2057. (thread_across_edge): Skip nop statements at the start of a
  2058. block.
  2059. (dom_opt_initialize_block_local_data): Clear block_defs
  2060. appropriately.
  2061. (record_equivalences_from_phis): Accept walk_data structure.
  2062. Call register_new_def appropriately.
  2063. (optimize_stmt): Call register_new_defs_for_stmt.
  2064. (dom_opt_finalize_block): Restore CURRDEFS appropriately.
  2065. (register_new_definitions_for_stmt): New.
  2066. * tree-ssa.c: Update copyright dates.
  2067. (register_new_def): No longer static. Accept additional argument
  2068. for the table to hold the new definition. Callers updated.
  2069. * gimplify.c: Update copyright dates.
  2070. * tree-cfg.c: Likewise.
  2071. * tree.h: Likewise.
  2072. * tree-iterator.c, tree-iterator.c: Use GCC rather than GNU CC.
  2073. * tree-ssa-pre.c, tree-ssa-live.h: Likewise.
  2074. 2004-01-19 Daniel Berlin <dberlin@dberlin.org>
  2075. * timevar.def (TV_TREE_SPLIT_EDGES): New timevar.
  2076. * tree-ssa-pre.c (split_critical_edges): Move from here
  2077. (pass_pre): Add PROP_no_crit_edges as required.
  2078. * tree-cfg.c (split_critical_edges): to here.
  2079. (pass_split_crit_edges): New pass.
  2080. * tree-optimize.c (tree_optimization_passes): Add NEXT_PASS
  2081. (split_crit_edges).
  2082. * tree-pass.h: Add PROP_no_crit_edges.
  2083. (pass_split_crit_edges): Declared.
  2084. 2004-01-19 Frank Ch. Eigler <fche@redhat.com>
  2085. * tree-mudflap.c (mf_build_check_statement_for): Tolerate
  2086. incoming locus NULL pointer.
  2087. 2004-01-18 Richard Henderson <rth@redhat.com>
  2088. * builtins.c (simplify_builtin_strcpy): Export. Take strlen argument.
  2089. (simplify_builtin_strncpy, simplify_builtin_strcmp): Similarly.
  2090. (simplify_builtin_strncmp): Similarly.
  2091. (simplify_builtin): Update to match.
  2092. * expr.h (simplify_builtin_strcmp, simplify_builtin_strncmp,
  2093. simplify_builtin_strcpy, simplify_builtin_strncpy): Declare.
  2094. * tree-pass.h (pass_fold_builtins): New.
  2095. * tree-optimize.c (init_tree_optimization_passes): Add it.
  2096. * tree-ssa-ccp.c (ccp_fold_builtin): Handle BUILT_IN_STRCPY,
  2097. BUILT_IN_STRNCPY, BUILT_IN_STRCMP, BUILT_IN_STRNCMP.
  2098. (get_strlen): Don't cast to size_t.
  2099. (execute_fold_all_builtins, pass_fold_builtins): New.
  2100. 2004-01-19 Jan Hubicka <jh@suse.cz>
  2101. PR opt/13729
  2102. * cgraphunit.c (cgraph_finalize_compilation_unit): Fix memory leak.
  2103. (cgraph_remove_unreachable_nodes): Do not mix analyzed and
  2104. DECL_SAVED_TREE flags.
  2105. 2004-01-18 Richard Henderson <rth@redhat.com>
  2106. * tree-sra.c (REALPART_INDEX, IMAGPART_INDEX): Remove.
  2107. (sra_candidates, needs_copy_in): Use a bitmap. Update all users.
  2108. (struct sra_elt, sra_elt_hash, sra_elt_eq): New.
  2109. (sra_map_size): Remove.
  2110. (sra_map): Use a htab_t.
  2111. (lookup_scalar): Update to match.
  2112. (get_scalar_for_field, get_scalar_for_complex_part): Likewise.
  2113. (scalarize_structure_assignment): Use annotate_all_with_locus.
  2114. (csc_build_component_ref): Remove index argument.
  2115. (csc_build_complex_part): Take tree_code, not index.
  2116. (create_scalar_copies): Don't collect indicies.
  2117. (emit_scalar_copies): New.
  2118. (scalarize_modify_expr, scalarize_tree_list): Use it.
  2119. (scalarize_return_expr): Likewise.
  2120. (scalarize_structures): Simplify needs_copy_in iteration.
  2121. (scalarize_call_expr): Use annotate_all_with_locus.
  2122. (dump_sra_map_trav): Split from ...
  2123. (dump_sra_map): ... here. Update for hash table.
  2124. (tree_sra): Update for new datastructures.
  2125. 2004-01-18 Richard Henderson <rth@redhat.com>
  2126. * tree-cfg.c (dump_function_to_file): Move ";; Function" header ...
  2127. * tree-optimize.c (execute_one_pass): ... here.
  2128. 2004-01-17 Daniel Berlin <dberlin@dberlin.org>
  2129. * tree-alias-common.c: s@_typevar@_var@g, s@_TVAR@_VAR@g,
  2130. s@_TYPEVAR@_VAR@g
  2131. * tree-alias-common.h: Ditto
  2132. * tree.h: Ditto
  2133. * tree-alias-ander.c: Ditto
  2134. * tree-alias-type.c: Ditto
  2135. * tree-alias-type.h: Ditto
  2136. 2004-01-17 Richard Henderson <rth@redhat.com>
  2137. * tree-complex.c (gimplify_val): Copy TREE_BLOCK.
  2138. * tree-complex.c (gimplify_val): New.
  2139. (extract_component, do_binop, do_unop): Use it.
  2140. 2004-01-17 Richard Henderson <rth@redhat.com>
  2141. * tree-complex.c (expand_complex_operations_1): Fix RETURN_EXPR
  2142. thinko in last change.
  2143. 2004-01-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  2144. * cfghooks.c (split_block): Don't redirect edges.
  2145. * cfgrtl.c (rtl_split_block): Do it here.
  2146. * tree-cfg.c (tree_split_block): Ditto.
  2147. 2004-01-17 Richard Henderson <rth@redhat.com>
  2148. * tree-cfg.c (verify_expr): Tidy. Check COND_EXPR for boolean
  2149. condition.
  2150. 2004-01-17 Jan Hubicka <jh@suse.cz>
  2151. PR optimization/11761
  2152. * Makefile.in: Remove tree-simple.c from GTYized files.
  2153. * tree-dfa.c (find_addressable_vars): Parse nontrivial ADDR_EXPRs.
  2154. (discover_nonconstant_array_refs_r): New static function.
  2155. (discover_nonconstant_array_refs): New global function.
  2156. * tree-flow.h (discover_nonconstant_array_refs): Declare.
  2157. * tree-simple.c (types_checked, types_in_memory): Kill.
  2158. (struct_needs_to_live_in_memory): Kill.
  2159. (needs_to_live_in_memory): aggregates are safe.
  2160. * tree-ssa.c (rewrite_out_of_ssa): Call the new function.
  2161. 2004-01-17 Richard Henderson <rth@redhat.com>
  2162. PR opt/13718
  2163. * tree-complex.c (expand_complex_comparison): Handle COND_EXPR.
  2164. (expand_complex_operations_1): Likewise.
  2165. 2004-01-17 Richard Henderson <rth@redhat.com>
  2166. * tree-sra.c (scalarize_tree_list): Take bitmap argument to
  2167. avoid emitting duplicates. Update all callers.
  2168. 2004-01-17 Richard Henderson <rth@redhat.com>
  2169. PR opt/13718
  2170. * tree-complex.c (expand_complex_comparison): New.
  2171. (expand_complex_operations_1): Handle EQ_EXPR and NE_EXPR.
  2172. 2004-01-16 Daniel Berlin <dberlin@dberlin.org>
  2173. * tree-alias-common.c (get_alias_var): Handle BIT_FIELD_REF.
  2174. (find_func_aliases): Ditto.
  2175. Update for fact that basic component_refs are no longer
  2176. is_gimple_variable.
  2177. (create_fun_alias_var): Set DECL_CONTEXT on our faked declarations.
  2178. (pass_del_pta): PTA dumps info on delete, so it needs a name.
  2179. 2004-01-16 Steven Bosscher <stevenb@suse.de>
  2180. * tree-optimize.c (init_tree_optimization_passes): Run DCE
  2181. before the first dominator optimization pass.
  2182. 2004-01-15 Brian Booth <bbooth@redhat.com>
  2183. Richard Henderson <rth@redhat.com>
  2184. * tree-sra.c (REALPART_INDEX, IMAGPART_INDEX): New.
  2185. (sra_map_size): New.
  2186. (make_temp): New.
  2187. (mark_all_vdefs): New.
  2188. (is_sra_candidate_decl): New.
  2189. (is_sra_candidate_ref): New.
  2190. (lookup_scalar): Use sra_map_size, make_temp.
  2191. (get_scalar_for_field): Rename from get_scalar_for.
  2192. (get_scalar_for_complex_part): New.
  2193. (can_be_scalarized_p): Handle COMPLEX_TYPE.
  2194. (scalarize_component_ref): Handle REAL/IMAGPART_EXPR.
  2195. (scalarize_structure_assignment): Tidy.
  2196. (find_candidates_for_sra): Handle COMPLEX_TYPE, return bool.
  2197. (csc_assign, csc_build_component_ref): Split out from ...
  2198. (create_scalar_copies): ... here. Handle COMPLEX_TYPE.
  2199. (csc_build_complex_part): New.
  2200. (scalarize_modify_expr): Use is_sra_candidate_foo.
  2201. (scalarize_tree_list): Likewise.
  2202. (scalarize_return_expr): Likewise.
  2203. (dump_sra_map): Split out from ...
  2204. (tree_sra): ... here. Tidy.
  2205. 2004-01-15 Frank Ch. Eigler <fche@redhat.com>
  2206. * tree-mudflap.c (mf_xform_derefs): Accept void return statements.
  2207. 2004-01-15 Andrew MacLeod <amacleod@redhat.com>
  2208. Jeff Law <law@redhat.com>
  2209. * tree-ssa-dom.c (remove_local_expressions_from_table): New function
  2210. extracted from dom_opt_finalize_block.
  2211. (restore_vars_to_originalvalue): Likewise.
  2212. (extract_true_false_edges_from_block): Likewise.
  2213. (thread_across_edge): Handle if (cond) too.
  2214. (dom_opt_finalize_block): Use new functions. Handle if (cond).
  2215. * tree-ssa-dom.c (thread_across_edge): Accept dom_walk argument.
  2216. Record temporary equivalences created by PHIs and temporarily
  2217. const/copy propagate into conditionals.
  2218. (dom_opt_finalize_block): Thread across an edge to a dominated block
  2219. if the dominated block has PHIs. Remove temporary equivalenecs
  2220. created by PHIs in thread_across_edge. Update code to restore the
  2221. various hash tables to use the actual varray rather than a local
  2222. copy of the varray.
  2223. (simplify_rhs_and_lookup_avail_expr): Set the condition's code
  2224. before settings its operands.
  2225. * tree-ssa.c (create_temp): Use add_referenced_var rather than
  2226. an incomplete inline of its behavior. Also make sure to
  2227. set is_dereferenced_{load,store}, is_call_clobbered and is_stored.
  2228. * tree-ssa-live.c (build_tree_conflict_graph): Correctly handle
  2229. case where the result of a PHI is unused.
  2230. 2004-01-15 Diego Novillo <dnovillo@redhat.com>
  2231. * cfghooks.c (predicted_by_p): Add missing return.
  2232. 2004-01-15 Richard Henderson <rth@redhat.com>
  2233. * tree-ssa-dom.c (optimize_stmt): Dump new statement if
  2234. folding succeeded.
  2235. 2004-01-15 Kazu Hirata <kazu@cs.umass.edu>
  2236. * tree-cfg.c: Fix comment typos.
  2237. * tree-eh.c: Likewise.
  2238. * tree-inline.c: Likewise.
  2239. * tree-optimize.c: Likewise.
  2240. * tree-ssa.c: Likewise.
  2241. * tree-ssa-dom.c: Likewise.
  2242. * tree-ssa-operands.c: Likewise.
  2243. * tree-ssa-pre.c: Likewise.
  2244. * tree-tailcall.c: Likewise.
  2245. 2004-01-14 Jan Hubicka <jh@suse.cz>
  2246. * basic-block.h: Include predict.h
  2247. (tree_predicted_by_p, rtl_predicted_by_p, rtl_predict_edge,
  2248. predict_edge_def): Declare.
  2249. * cfghooks.h (cfg_hooks): add predict_edge and predicted_by_p
  2250. (predict_edge, predicted_by_p): Declare.
  2251. * cfghooks.c (predict_edge, predicted_by_p): Declare.
  2252. * cfgrtl (rtl_cfg_hooks, cfg_layout_rtl_cfg_hook): Add new hooks.
  2253. * cse.c (struct cse_basic_block_data): Rename enum values to not
  2254. conflict with profile.h; update all uses.
  2255. * predict.c: Include tree-flow.h, ggc.h, tree-dump.h
  2256. (predicted_by_p): Rename to ...
  2257. (rtl_predicted_by_p): .. this one; make global
  2258. (tree_predicted_by_p): New.
  2259. (dump_prediction): Add FILE argument.
  2260. (predict_edge): Rename to ...
  2261. (rtl_predict_edge): .. this one.
  2262. (tree_predict_edge): New.
  2263. (combine_predictions_for_insn): Update calls of predict_edge.
  2264. (predict_loops): Break out from ...
  2265. (estimate_probability): ... here; update comments; move updating
  2266. of unknown probabilities from ...
  2267. (estimate_bb_frequencies): ... here.
  2268. (combine_predictions_for_bb): New.
  2269. (tree_predict_by_opcode): New.
  2270. (tree_estimate_probability): New.
  2271. * predict.def (PRED_TREE_POINTER, PRED_TREE_OPCODE_POSITIVE,
  2272. PRED_TREE_OPCODE_NONEQUAL, PRED_TREE_FPOPCODE): New predictors.
  2273. * predict.h: Add include guard.
  2274. (predict_edge, predict_edge_def): Move prototypes to basic_block.h
  2275. * tree-cfg.c (tree_cfg_hooks): Add prediction hooks.
  2276. * tree-dump.c (dump_files): Add profile.
  2277. * tree-flow.h (struct edge_prediction): New structure.
  2278. (struct bb_ann_d): Add field predictions.
  2279. (tree_estimate_probability): Declare.
  2280. * tree-optimize.c (optimize_function_tree): Call tree_estimate_probability.
  2281. * tree.h (tree_dump_index): Add TDI_profile.
  2282. * tree-pass.h (pass_profile): Declare.
  2283. 2004-01-14 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  2284. * basic-block.h (find_basic_blocks, cleanup_cfg,
  2285. delete_unreachable_blocks, merge_seq_blocks): Declare.
  2286. * cfgcleanup.c (merge_seq_blocks): New.
  2287. * output.h (find_basic_blocks, cleanup_cfg, delete_unreachable_blocks):
  2288. Declarations moved to basic-block.h.
  2289. * tree-cfg.c (tree_merge_blocks, tree_can_merge_blocks_p): New.
  2290. (cleanup_tree_cfg): Call merge_seq_blocks.
  2291. (tree_cfg_hooks): Add tree_can_merge_blocks_p and tree_merge_blocks.
  2292. 2004-01-14 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  2293. * tree-cfg.c (tree_make_forwarder_block): Fix.
  2294. 2004-01-14 Richard Henderson <rth@redhat.com>
  2295. * tree-complex.c: New file.
  2296. * Makefile.in (OBJS-common): Add it.
  2297. * tree-pass.h (pass_lower_complex): New.
  2298. * tree-optimize.c (init_tree_optimization_passes): Add it.
  2299. 2004-01-14 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  2300. * Makefile.in (tree-ssa-loop.o): Add cfgloop.h dependency.
  2301. (cfghooks.o): Add TIMEVAR_H and toplev.h dependency.
  2302. * basic-block.h (struct edge_def): Use ir_type instead testing of
  2303. cfg_hooks directly.
  2304. (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info):
  2305. Declaration removed.
  2306. * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c.
  2307. * cfgcleanup.c (try_simplify_condjump): Changed due to change of
  2308. tidy_fallthru_edge.
  2309. * cfghooks.c: Include timevar.h and toplev.h.
  2310. (cfg_hooks): Made static.
  2311. (tree_register_cfg_hooks, ir_type): New.
  2312. (verify_flow_info, dump_bb): Moved from cfg.c.
  2313. (redirect_edge_and_branch, redirect_edge_and_branch_force,
  2314. split_block, split_block_after_labels, move_block_after,
  2315. delete_basic_block, split_edge, create_basic_block,
  2316. create_empty_bb, can_merge_blocks_p, merge_blocks,
  2317. make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New.
  2318. * cfghooks.h (struct cfg_hooks): Modified.
  2319. (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block,
  2320. delete_basic_block, split_edge, create_basic_block, can_merge_blocks_p,
  2321. merge_blocks, make_forwarder_block): Changed into functions.
  2322. (loop_optimizer_init, loop_optimizer_finalize): Removed.
  2323. (HEADER_BLOCK, LATCH_EDGE): Moved into cfgloop.c.
  2324. (tidy_fallthru_edge, tidy_fallthru_edges, create_empty_bb,
  2325. verify_flow_info, dump_bb, ir_type): Declare.
  2326. (cfg_layout_rtl_cfg_hooks): Declare.
  2327. * cfglayout.c (copy_bbs): Don't call add_to_dominance_info.
  2328. * cfgloop.c (HEADER_BLOCK, LATCH_EDGE): Moved from cfghooks.h.
  2329. (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions.
  2330. (canonicalize_loop_headers): Use new semantics of make_forwarder_block.
  2331. * cfgloop.h (rtl_loop_optimizer_init, rtl_loop_optimizer_finalize):
  2332. Removed.
  2333. (loop_optimizer_init, loop_optimizer_finalize): Declare.
  2334. * cfgloopmanip.c (split_loop_bb): Don't update dominators.
  2335. (remove_bbs): Don't call remove_bbs.
  2336. (create_preheader): Use make_forwarder_block.
  2337. (mfb_keep_just, mfb_update_loops): New static functions.
  2338. * cfgrtl.c (cfg_layout_split_block, rtl_split_block,
  2339. rtl_make_forwarder_block, rtl_create_basic_block,
  2340. rtl_delete_block, rtl_split_block, rtl_merge_blocks,
  2341. tidy_fallthru_edge, rtl_split_edge, cfg_layout_merge_blocks,
  2342. cfg_layout_split_edge): Parts not specific to rtl moved to cfghooks.c
  2343. (tidy_fallthru_edges): Moved to cfghooks.c.
  2344. (rtl_move_block_after): New.
  2345. (redirect_edge_with_latch_update, update_cfg_after_block_merging):
  2346. Removed.
  2347. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Modified.
  2348. * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1,
  2349. find_if_case_2): Don't update dominators.
  2350. * loop-init.c (rtl_loop_optimizer_init, rtl_loop_optimizer_finalize):
  2351. Replaced by rtl_loop_optimizer_init and rtl_loop_optimizer_finalize.
  2352. * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info.
  2353. * toplev.c (rest_of_handle_loop2): Enter cfglayout mode here.
  2354. * tree-cfg.c (create_bb): Modified to suit create_basic_block hook.
  2355. (tree_redirect_edge_and_branch_1): Merged into
  2356. tree_redirect_edge_and_branch.
  2357. (create_blocks_annotations): Removed.
  2358. (tree_loop_optimizer_init, tree_loop_optimizer_finalize): Removed.
  2359. (tree_make_forwarder_block, remove_bb, tree_split_edge,
  2360. tree_redirect_edge_and_branch, tree_split_block,
  2361. tree_move_block_after): Partially moved to cfghooks.c.
  2362. (tree_duplicate_bb): New.
  2363. (PENDING_STMT): Moved to tree-flow.h.
  2364. (tree_register_cfg_hooks): Moved to cfghooks.c.
  2365. (build_tree_cfg): Don't call create_blocks_annotations.
  2366. (factor_computed_gotos, make_blocks): Use create_empty_bb.
  2367. (cleanup_tree_cfg): Use delete_unreachable_blocks.
  2368. (remove_unreachable_blocks, insert_bb_before): Removed.
  2369. (remove_phi_nodes_and_edges_for_unreachable_block): Modified.
  2370. (tree_find_edge_insert_loc, thread_jumps): Use cfg hooks.
  2371. (bsi_commit_edge_inserts): Update_annotations argument removed.
  2372. (tree_cfg_hooks): Modified.
  2373. * tree-flow.h (PENDING_STMT): Moved from tree-cfg.c.
  2374. (insert_bb_before, remove_unreachable_blocks,
  2375. remove_phi_nodes_and_edges_for_unreachable_block, tree_split_edge):
  2376. Declaration removed.
  2377. (bsi_commit_edge_inserts): Declaration changed.
  2378. (tree_duplicate_bb): Declare.
  2379. * tree-sra.c (scalarize_structures): Changed due to
  2380. bsi_commit_edge_inserts change.
  2381. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Use
  2382. delete_unreachable_blocks.
  2383. * tree-ssa-loop.c: Include cfgloop.h.
  2384. * tree-ssa-pre.c (split_critical_edges, tree_perform_ssapre): Use cfg
  2385. hooks.
  2386. * tree-ssa.c (rewrite_trees, rewrite_vars_out_of_ssa): Changed due to
  2387. bsi_commit_edge_inserts change.
  2388. (ssa_redirect_edge): Record the phi arguments on the redirected edge.
  2389. * tree-tailcall.c (eliminate_tail_call): Clean stored phi arguments.
  2390. 2004-01-13 Richard Henderson <rth@redhat.com>
  2391. * gimplify.c (gimplify_lhs_complex_part_expr): Remove.
  2392. (gimplify_modify_expr): Don't call it.
  2393. * tree-alias-common.c (HAVE_BANSHEE): Make sure it's defined.
  2394. (pass_build_pta): Set name.
  2395. 2004-01-13 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  2396. * tree-tailcall.c (eliminate_tail_call): Add phi nodes for the call
  2397. vdefs.
  2398. (find_tail_calls): Ignore returns with virtual operands.
  2399. 2004-01-12 Richard Henderson <rth@redhat.com>
  2400. * tree-pass.h: New file.
  2401. * gimple-low.c: Include tree-pass.h.
  2402. (lower_function_body): Make static, take no arguments. Set
  2403. dont_emit_block_notes and call reset_block_changes here.
  2404. (pass_lower_cf): New.
  2405. * toplev.c (general_init): Call init_tree_optimization_passes.
  2406. * toplev.h (init_tree_optimization_passes): Declare.
  2407. * tree-alias-ander.c: Include tree-pass.h.
  2408. (tree_dump_file, tree_dump_flags): Remove.
  2409. (andersen_init): Don't dump_begin.
  2410. (andersen_cleanup): Don't dump_end.
  2411. * tree-alias-common.c: Include tree-pass.h, timevar.h.
  2412. (currptadecl): Remove.
  2413. (create_alias_vars): Make static, take no args. Tidy ifdefs.
  2414. (delete_alias_vars): Likewise. Protect vs PTA_ANDERSEN.
  2415. (pass_build_pta, pass_del_pta): New.
  2416. * tree-alias-common.h (create_alias_vars): Delete decl.
  2417. (delete_alias_vars): Likewise.
  2418. * tree-cfg.c: Include tree-pass.h.
  2419. (tree_dump_file, tree_dump_flags): Remove.
  2420. (build_tree_cfg): Don't timevar, do init_flow. Ensure one bb.
  2421. Don't dump the function here.
  2422. (execute_build_cfg, pass_build_cfg): New.
  2423. (remove_useless_stmts): Make static, take no arguments.
  2424. (pass_remove_useless_stmts): New.
  2425. (remove_bb): Don't open the dump file.
  2426. * tree-dfa.c: Include tree-pass.h.
  2427. (tree_dump_file, tree_dump_flags): Remove.
  2428. (find_referenced_vars): Make static, take no args. Do init_tree_ssa.
  2429. (compute_may_aliases): Similarly. Don't timevar or open dump file.
  2430. Don't delete_alias_vars here.
  2431. (pass_referenced_vars, pass_may_alias): New.
  2432. * tree-dump.c (dump_files): Remove optimization dumps.
  2433. (extra_dump_files, extra_dump_files_in_use): New.
  2434. (extra_dump_files_alloced): New.
  2435. (dump_register): New.
  2436. (get_dump_file_info): New.
  2437. (dump_begin, dump_enabled_p, dump_flag_name): Use it.
  2438. (dump_enable_all): Handle extra_dump_files.
  2439. (dump_switch_p_1): Split out from dump_switch_p.
  2440. (dump_switch_p): Handle extra_dump_files.
  2441. * tree-dump.h (dump_register): Declare.
  2442. * tree-eh.c: Include tree-pass.h
  2443. (lower_eh_constructs): Make static, take no args. Don't timevar,
  2444. don't dump function.
  2445. (pass_lower_eh): New.
  2446. * tree-flow.h (remove_useless_stmts, find_referenced_vars,
  2447. compute_may_aliases, lower_function_body, rewrite_out_of_ssa,
  2448. tree_ssa_ccp, tree_ssa_dominator_optimize, tree_ssa_dce,
  2449. tree_ssa_loop_opt, lower_eh_constructs, tree_sra): Remove.
  2450. (rewrite_into_ssa): Update decl.
  2451. * tree-mudflap.c: Include tree-pass.h.
  2452. (mudflap_function_decls): Make static, take no args, don't process
  2453. functions with mf_marked_p.
  2454. (mudflap_function_ops): Likewise.
  2455. (gate_mudflap, pass_mudflap_1, pass_mudflap_2): New.
  2456. (mudflap_enqueue_decl): Don't open dump file.
  2457. (mudflap_enqueue_constant): Likewise.
  2458. * tree-nomudflap.c: Include tree-pass.h.
  2459. (mudflap_c_function_decls, mudflap_c_function_ops): Remove.
  2460. (pass_mudflap_1, pass_mudflap_2): New.
  2461. * tree-optimize.c: Include tree-pass.h.
  2462. (optimize_function_tree): Remove.
  2463. (tree_dump_file, tree_dump_flags, vars_to_rename): New.
  2464. (all_passes): New.
  2465. (execute_gimple, pass_gimple): New.
  2466. (execute_rebuild_bind, pass_rebuild_bind): New.
  2467. (gate_all_optimizations, pass_all_optimizations): New.
  2468. (execute_del_cfg, pass_del_cfg): New.
  2469. (register_one_dump_file, register_dump_files): New.
  2470. (dup_pass_1, init_tree_optimization_passes): New.
  2471. (current_properties, last_verified): New.
  2472. (execute_todo, execute_one_pass, execute_pass_list): New.
  2473. (tree_rest_of_compilation): Remove -O0 passes.
  2474. * tree-sra.c: Include tree-pass.h, flags.h.
  2475. (tree_dump_file, tree_dump_flags, vars_to_rename): Remove.
  2476. (tree_sra): Make static, take no args. Don't timevar or dump file.
  2477. (gate_sra, pass_sra): New.
  2478. * tree-ssa-ccp.c: Include tree-pass.h, flags.h.
  2479. (tree_dump_file, tree_dump_flags): New.
  2480. (tree_ssa_ccp): Make static, take no args. Don't timevar or dump file.
  2481. (gate_ccp, pass_ccp): New.
  2482. (substitute_and_fold): Take no args.
  2483. * tree-ssa-dce.c: Include tree-pass.h, flags.h.
  2484. (tree_dump_file, tree_dump_flags): New.
  2485. (tree_ssa_dce): Make static, take no args. Don't open dump file.
  2486. (gate_dce, pass_dce): New.
  2487. * tree-ssa-dom.c: Include tree-pass.h, flags.h.
  2488. (tree_dump_file, tree_dump_flags, vars_to_rename): Remove.
  2489. (tree_ssa_dominator_optimize): Make static, take no args, don't
  2490. timevar, don't dump file.
  2491. (gate_dominator, pass_dominator): New.
  2492. * tree-ssa-loop.c: Include tree-pass.h, flags.h.
  2493. (tree_dump_file, tree_dump_flags): Remove.
  2494. (tree_ssa_loop_opt): Make static, take no args, don't open dump file.
  2495. (gate_loop, pass_loop): New.
  2496. * tree-ssa-pre.c: Include tree-pass.h, flags.h.
  2497. (tree_dump_file, tree_dump_flags): Remove.
  2498. (execute_pre): Rename from tree_perform_ssapre, make static,
  2499. take no args, don't timevar, don't open dump file, don't allocate
  2500. vars_to_rename.
  2501. (gate_pre, pass_pre): New.
  2502. * tree-ssa.c: Include tree-pass.h.
  2503. (tree_dump_file, tree_dump_flags, vars_to_rename): Remove.
  2504. (rewrite_into_ssa): Take no arguments, don't open dump file.
  2505. (rewrite_out_of_ssa): Make static, take no args, don't timevar,
  2506. don't open dump file. Disable TER if mudflap.
  2507. (pass_build_ssa, pass_del_ssa): New.
  2508. * tree-tailcall.c: Include tree-pass.h, flags.h.
  2509. (tree_dump_file, tree_dump_flags): Remove.
  2510. (tree_optimize_tail_calls_1): Rename from tree_optimize_tail_calls.
  2511. Make static, take only opt_tailcalls, don't dump file.
  2512. (execute_tail_recursion, gate_tail_calls, execute_tail_calls): New.
  2513. (pass_tail_recursion, pass_tail_calls): New.
  2514. * tree.h (enum tree_dump_index): Remove optimization dumps.
  2515. * Makefile.in (tree-alias-ander.o, tree-alias-common.o, tree-ssa.o,
  2516. tree-ssa-dom.o, tree-ssa-pre.o, tree-cfg.o, tree-tailcall.o,
  2517. tree-dfa.o, tree-eh.o, tree-ssa-loop.o, tree-optimize.o, gimple-low.o,
  2518. tree-mudflap.o, tree-ssa-dce.o, tree-ssa-ccp.o, tree-sra.o: Update
  2519. dependencies.
  2520. 2004-01-12 Frank Ch. Eigler <fche@redhat.com>
  2521. * tree-mudflap.c (mf_xform_derefs): Restore instrumentation of
  2522. RETURN_EXPRs.
  2523. 2004-01-11 Jan Hubicka <jh@suse.cz>
  2524. * tree-cfg.c (remove_usless_stmts_cond): Fold statement.
  2525. (remove_useless_stmts_1): Fold trees we know how to fold.
  2526. 2004-01-09 Richard Henderson <rth@redhat.com>
  2527. * gimplify.c (gimplify_constructor): Merge into ...
  2528. (gimplify_init_constructor): ... here. Handle COMPLEX_TYPE and
  2529. VECTOR_TYPE.
  2530. (gimplify_lhs_complex_part_expr): New.
  2531. (gimplify_modify_expr): Call it.
  2532. * tree-simple.c (is_gimple_rhs): Accept COMPLEX_EXPR.
  2533. * c-pretty-print.c (pp_c_initializer): Accept any type CONSTRUCTOR.
  2534. (pp_c_initializer_list): Fix code expectations for VECTOR_TYPE and
  2535. COMPLEX_TYPE.
  2536. 2004-01-09 Steven Bosscher <stevenb@suse.de>
  2537. PR optimization/13599
  2538. * tree-cfg.c (remove_useless_stmts_cond): Clear last-goto
  2539. before returning.
  2540. 2004-01-09 Richard Henderson <rth@redhat.com>
  2541. * gimplify.c (gimplify_asm_expr): Fix ordering of ASM_INPUTS.
  2542. 2004-01-09 Jan Hubicka <jh@suse.cz>
  2543. * cgraph.h (cgraph_clone_inlined_nodes): Declare.
  2544. * cgraphunit.c (cgrpah_clone_inlined_nodes): Make global.
  2545. (cgraph_mark_inline_edge): Sanity check that size is positive.
  2546. (cgraph_decide_inlining): Fix typo.
  2547. * tree-optimize.c (tree_rest_of_compilation): Fix node duplication
  2548. code.
  2549. 2004-01-09 Jan Hubicka <jh@suse.cz>
  2550. * tree-inline.c (estimate_num_insns_1): Fix.
  2551. 2004-01-09 Richard Henderson <rth@redhat.com>
  2552. * tree-alias-ander.c, tree-cfg.c, tree-dfa.c, tree-mudflap.c,
  2553. tree-sra.c, tree-ssa-ccp.c, tree-ssa-dce.c, tree-ssa-dom.c,
  2554. tree-ssa-loop.c, tree-ssa-pre.c, tree-ssa.c, tree-tailcall.c: Rename
  2555. dump_file and dump_flags to tree_dump_file/flags.
  2556. 2004-01-08 Frank Ch. Eigler <fche@redhat.com>
  2557. * tree-mudflap.c (mf_build_string): Properly mf_mark string.
  2558. (mf_varname_tree): Remove redundant marking.
  2559. * tree-optimize.c (tree_rest_of_compilation): Skip mudflap processing
  2560. of mf_marked functions.
  2561. * c-mudflap.c (mflang_flush_calls): mf_mark synthetic function.
  2562. 2004-01-07 Diego Novillo <dnovillo@redhat.com>
  2563. * Makefile.in (OBJS-common): Remove tree-must-alias.o
  2564. (tree-must-alias.o): Remove.
  2565. * common.opt (ftree-must-alias): Remove.
  2566. * flags.h (flag_tree_must_alias): Remove. Update all users.
  2567. * timevar.def (TV_TREE_MUST_ALIAS): Remove.
  2568. * toplev.c (f_options): Remove entry for -ftree-must-alias.
  2569. * tree-alias-common.c (local_alias_vars): Add GTY marker.
  2570. (local_alias_varnums): Likewise.
  2571. * tree-dfa.c (aliases_computed_p): Declare.
  2572. (dump_variable): Show variable UID and dereferenced bits.
  2573. (compute_may_aliases): Add arguments 'vars_to_rename' and 'phase'.
  2574. Do not call create_alias_vars.
  2575. Call promote_call_clobbered_vars
  2576. Do debugging dumps.
  2577. Set 'aliases_computed_p' to true before returning.
  2578. (create_memory_tags): Call may_be_aliased.
  2579. Mark new memory tags for renaming.
  2580. (compute_alias_sets): Don't do debugging dumps.
  2581. (find_variable_in): Move from tree-must-alias.c
  2582. (remove_element_from): Likewise.
  2583. (find_addressable_vars): Likewise
  2584. (promote_call_clobbered_vars): New.
  2585. (get_memory_tag_for): Mark the tag volatile if the pointed-to type
  2586. is volatile.
  2587. * tree-dump.c (dump_files): Remove entry for tree-mustalias.
  2588. Add entries for tree-ssa7, tree-dom3 and tree-dce3.
  2589. * tree-flow-inline.h (may_be_aliased): New.
  2590. * tree-flow.h (may_be_aliased): Declare.
  2591. (aliases_computed_p): Declare.
  2592. (tree_compute_must_alias): Remove.
  2593. * tree-must-alias.c: Remove.
  2594. * tree-optimize.c: Include tree-alias-common.h.
  2595. (optimize_function_tree): Call create_alias_vars before going into
  2596. SSA form.
  2597. Do not compute aliases until after the first DOM and DCE passes.
  2598. Run DOM and DCE once more after computing may-aliases.
  2599. * tree-ssa-dom.c (propagate_copy): Merge the dereferenced bit flags
  2600. when copy propagating pointers.
  2601. * tree-ssa-operands.c (get_stmt_operands): Assume that the
  2602. statement has no volatile operands.
  2603. (get_expr_operands): When processing an INDIRECT_REF expressions,
  2604. mark the statement as having volatile operands if aliases have not
  2605. been computed.
  2606. (add_stmt_operand): If the variable may be aliased and aliasing has
  2607. not been computed yet, mark the statement as having volatile
  2608. operands.
  2609. * tree-ssa.c (init_tree_ssa): Set aliases_computed_p to false.
  2610. (delete_tree_ssa): Likewise.
  2611. * tree.h (tree_dump_index): Remove TDI_mustalias.
  2612. Add TDI_dom_3, TDI_ssa_7 and TDI_dce_3.
  2613. * doc/invoke.texi: Remove must-alias documentation.
  2614. 2004-01-07 Jeff Law <law@redhat.com>
  2615. * tree-ssa-dce.c (find_useful_stmts): Do not consider PHIs for
  2616. virtual operands inherently necessary.
  2617. 2004-01-07 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  2618. * tree-dfa.c (free_df_for_stmt, free_df): New functions.
  2619. (compute_immediate_uses_for_stmt): Record uses in VDEFs.
  2620. * tree-flow.h (free_df, kill_redundant_phi_nodes): Declare.
  2621. * tree-optimize.c (optimize_function_tree): Call
  2622. kill_redundant_phi_nodes.
  2623. * tree-ssa-ccp.c (finalize): Call free_df.
  2624. * tree-ssa.c (replace_immediate_uses, raise_value,
  2625. kill_redundant_phi_nodes): New functions.
  2626. 2004-01-06 Jeff Law <law@redhat.com>
  2627. * tree.h (FUNCTION_RECEIVES_NONLOCAL_GOTO): Kill.
  2628. * tree-cfg.c (make_exit_edges, is_ctrl_altering_stmt): Use
  2629. current_function_has_nonlocal_label instead of
  2630. FUNCTION_RECEIVES_NONLOCAL_GOTO.
  2631. * gimplify.c (gimplify_expr): Set has_nonlocal_label in the
  2632. appropriate function's struct function rather than setting
  2633. a bit in the FUNCTION_DECL.
  2634. 2004-01-06 Jan Hubicka <jh@suse.cz>
  2635. * expr.c (string_constant): Recognize array_ref.
  2636. 2004-01-06 Richard Henderson <rth@redhat.com>
  2637. * builtins.c (builtin_save_expr): New.
  2638. (expand_builtin_mathfn, expand_builtin_mathfn_2,
  2639. expand_builtin_strcmp, expand_builtin_strncmp,
  2640. expand_builtin_strcat, fold_builtin_cabs): Use it.
  2641. 2004-01-06 Jan Hubicka <jh@suse.cz>
  2642. * fold-const.c (fold): Do not rebuild comparison when nothing
  2643. changed.
  2644. 2004-01-05 Jan Hubicka <jh@suse.cz>
  2645. * tree-ssa-ccp.c (ccp_fold_builtin): Return early for builtins
  2646. taking no arugment.
  2647. 2004-01-05 Steven Bosscher <steven@gcc.gnu.org>
  2648. * tree-ssa-dce.c: Clean up whitespace.
  2649. * tree-cfg.c (tree_verify_flow_info): Fix complaint about
  2650. missing or wrong labels in the targets of a conditional branch.
  2651. 2004-01-05 Richard Henderson <rth@redhat.com>
  2652. * tree-ssa-dom.c (record_equivalences_from_incoming_edge): Check
  2653. for signed zeros before recording value.
  2654. * Makefile.in (tree-ssa-dom.o): Depend on real.h.
  2655. 2004-01-05 Jeff Law <law@redhat.com>
  2656. * tree-ssa-dom.c (cprop_into_stmt): Remove hack which prevented
  2657. copy propagation into statements with virtual operands, but no
  2658. real operands.
  2659. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Correctly handle
  2660. the case where an edge we wish to redirect is split by the out of SSA
  2661. code.
  2662. 2004-01-05 Richard Henderson <rth@redhat.com>
  2663. * c-tree.h (struct lang_type): Add enum_min, enum_max.
  2664. * c-decl.c (finish_enum): Set them. Set TYPE_MIN/MAX_VALUE to
  2665. the limits of the compatible type, not to the enumerators.
  2666. (check_bitfield_type_and_width): Use them.
  2667. (finish_struct): Clear allocated struct lang_type.
  2668. * gimplify.c (gimplify_switch_expr): Remove special handling of
  2669. outer cast in a switch.
  2670. * tree-ssa-dom.c (record_equivalences_from_incoming_edge): Likewise.
  2671. 2004-01-05 Daniel Berlin <dberlin@dberlin.org>
  2672. * tree-ssa-pre.c (added_phis): Removed.
  2673. Remove gt-tree-ssa-pre.h.
  2674. (process_left_occs_and_kills): ASM_EXPR's block load pre.
  2675. * Makefile.in (GTFILES): Don't process tree-ssa-pre.c.
  2676. gt-tree-ssa-pre.h isn't a gtfile anymore.
  2677. 2004-01-05 Andrew Pinski <pinskia@physics.uc.edu>
  2678. * config.gcc (powerpc-*-darwin*): Make libbanshee rebuild
  2679. on PPC darwin.
  2680. 2004-01-05 Richard Henderson <rth@redhat.com>
  2681. * gimplify.c (gimplify_expr): Move check for error_mark inside
  2682. the main loop.
  2683. 2004-01-04 Jan Hubicka <jh@suse.cz>
  2684. * Makefile.in (cgraph.o, cgraphunit.o): Add intl.h dependency.
  2685. * cgraph.c (create_edge, dump_cgraph): Update to use inline_failed
  2686. * cgraph.h (cgraph_edge): Replace inline_call by inline_failed
  2687. (cgraph_inline_p): Add extra argument reason.
  2688. * cgraphunit.c: Minor formating fixes.
  2689. cgraph_first_inlined_callee): New functions.
  2690. (record_call_1): Record builtins too.
  2691. (cgraph_analyze_function): Update inline_failed messages.
  2692. (cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_inlined_into,
  2693. cgraph_inlined_callees, cgraph_estimate_growth): Update to use inline_failed.
  2694. (cgraph_check_inline_limits): Likewise; Add argument reason.
  2695. (cgraph_set_inline_failed): New static function.
  2696. (cgraph_decide_inlining_of_small_function, cgraph_decide_inlining): Set
  2697. reasons.
  2698. (cgraph_inline_p): Add new argument reason.
  2699. * tree-inline.c (expand_call_inline): Update warning.
  2700. 2004-01-04 Andreas Jaeger <aj@suse.de>
  2701. * common.opt: Re-order some options in ASCII collating orders.
  2702. 2004-01-03 Richard Henderson <rth@redhat.com>
  2703. * toplev.c (rest_of_compilation): Fixup merge error wrt
  2704. check_function_return_warnings.
  2705. * tree.h (FUNCTION_RECEIVES_NONLOCAL_GOTO): Use unsigned_flag.
  2706. 2004-01-02 Jan Hubicka <jh@suse.cz>
  2707. * c-decl.c (duplicate_decls): Output DIE of extern inline function
  2708. only when it can be inlined.
  2709. * c-objc-common.c (c_disregard_inline_limits): When not inlining
  2710. extern inline functions do not disregard.
  2711. * cgraphunit.c (cgraph_analyze_function): When not inlining do not set
  2712. inline.
  2713. (cgraph_decide_inlining): Limit work done when not inlining.
  2714. (cgrpah_decide_inlining_incrementally): Likewise.
  2715. * tree-optimize.c (tree_rest_of_compilation): Do not call
  2716. optimize_inline_calls
  2717. when there is nothing to inline.
  2718. 2004-01-01 Richard Henderson <rth@redhat.com>
  2719. * c-common.c (c_expand_expr): Don't handle STMT_EXPR.
  2720. * c-objc-common.c (c_objc_common_finish_file): Use expand_expr.
  2721. * c-semantics.c (lang_expand_stmt, lang_expand_decl_stmt,
  2722. expand_cond, genrtl_do_pushlevel, genrtl_goto_stmt, genrtl_expr_stmt,
  2723. genrtl_expr_stmt_value, genrtl_decl_stmt, genrtl_if_stmt,
  2724. genrtl_while_stmt, genrtl_do_stmt_1, genrtl_do_stmt,
  2725. genrtl_return_stmt, genrtl_for_stmt, genrtl_break_stmt,
  2726. genrtl_continue_stmt, genrtl_scope_stmt, genrtl_switch_stmt,
  2727. genrtl_case_label, genrtl_compound_stmt, genrtl_asm_stmt,
  2728. genrtl_cleanup_stmt, expand_stmt, find_reachable_label,
  2729. find_reachable_label_1, expand_unreachable_if_stmt,
  2730. expand_unreachable_stmt): Remove.
  2731. * c-common.h: Update.
  2732. 2003-12-31 Richard Henderson <rth@redhat.com>
  2733. * c-mudflap.c (mflang_register_call): Remove.
  2734. (mflang_flush_calls): Use start_function/finish_function.
  2735. * tree-mudflap.c (mf_init_extern_trees): Tidy.
  2736. (mf_decl_cache_locals): Fix chaining for empty body.
  2737. (deferred_static_decl_labels): Remove.
  2738. (deferred_static_decls_init): Remove.
  2739. (mudflap_register_call): New.
  2740. (mudflap_enqueue_decl): Use it. Remove label argument.
  2741. (mudflap_enqueue_constant): Likewise.
  2742. (mudflap_finish_file): Update to match.
  2743. * tree-mudflap.h (mudflap_enqueue_decl): Remove label argument.
  2744. (mudflap_enqueue_constant): Likewise.
  2745. (mflang_register_call): Remove.
  2746. * tree-nomudflap.c (mudflap_enqueue_decl): Remove label argument.
  2747. (mudflap_enqueue_constant): Likewise.
  2748. * tree-optimize.c (tree_ssa_finish): Don't create NULL bodies.
  2749. * varasm.c (make_decl_rtl): Update mudflap_enqueue_decl call.
  2750. (output_constant_def_contents): Similarly for mudflap_enqueue_constant.
  2751. 2003-12-26 Sebastian Pop <s.pop@laposte.net>
  2752. * tree-cfg.c (print_loop, print_pred_bbs, print_succ_bbs,
  2753. debug_loop_ir, print_loop_ir): New.
  2754. * tree-flow.h (debug_loop_ir, print_loop_ir): Declare.
  2755. 2003-12-23 Jeff Law <law@redhat.com>
  2756. * tree-cfg.c (tree_find_edge_insert_loc): Do not use the target
  2757. block as an insertion location if the target block has PHI nodes.
  2758. 2003-12-23 Jan Hubicka <jh@suse.cz>
  2759. * cgraphunit.c (cgraph_mark_inline): Accept argument edge; return
  2760. next edge not redirected.
  2761. (cgraph_recursive_inlining_p): Simplify.
  2762. (cgraph_decide_inlining*): Update calls of cgraph_mark_inline.
  2763. 2003-12-22 Toon Moene <toon@moene.indiv.nluug.nl>
  2764. * tree-alias-common.c (find_func_aliases): Do not call
  2765. intra_function_call for languages assuring no aliasing between
  2766. arguments (by themselves) and global memory.
  2767. 2003-12-21 Jan Hubicka <jh@suse.cz>
  2768. * tree-ssa-ccp.c (fold_stmt): Return when there is no RHS
  2769. (get_rhs): Return for RETURN_EXPR with no operand.
  2770. 2003-12-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  2771. * tree-cfg.c (tree_make_forwarder_block): Use split_block.
  2772. (tree_split_block): New.
  2773. (tree_cfg_hooks): Add tree_split_block.
  2774. (tree_loop_optimizer_init): Enable force_single_succ_latches.
  2775. * cfgloopmanip.c (loop_split_edge_with): Don't update dominators.
  2776. * cfgrtl.c (rtl_split_edge, cfg_layout_split_edge): Update dominators.
  2777. 2003-12-19 Daniel Berlin <dberlin@dberlin.org>
  2778. * tree-dfa.c (alias_stats_d): New structure.
  2779. (alias_stats): New variable.
  2780. (create_memory_tags): Zero out alias_stats.
  2781. (dump_alias_stats): New function.
  2782. (compute_alias_sets): Call it if TDF_STATS is set.
  2783. (may_alias_p): Collect the various statistics.
  2784. 2003-12-19 Diego Novillo <dnovillo@redhat.com>
  2785. * gimple-low.c (expand_var_p): Always expand volatiles.
  2786. * tree-dfa.c (find_referenced_vars): Move up in the file.
  2787. (create_memory_tags): New local function.
  2788. (compute_may_aliases): Call it.
  2789. (add_referenced_var): Move code to create memory tags and create
  2790. aliasing arrays to create_memory_tags.
  2791. (get_memory_tag_for): Don't mark memory tags volatile. Mark them
  2792. addressable.
  2793. * tree-flow.h (var_ann_d): Add bitfields is_dereferenced_store and
  2794. is_dereferenced_load.
  2795. (add_call_clobbered_var): Remove.
  2796. * tree-ssa-operands.c (check_optype_freelist): Mark arguments
  2797. unused.
  2798. (add_optype_freelist): Likewise.
  2799. (add_stmt_operand): Don't add operands for volatile variables.
  2800. 2003-12-19 Kazu Hirata <kazu@cs.umass.edu>
  2801. * dominance.c: Fix comment typos.
  2802. * et-forest.c: Likewise.
  2803. * et-forest.h: Likewise.
  2804. * tree-cfg.c: Likewise.
  2805. * tree-eh.c: Likewise.
  2806. * tree-mudflap.c: Likewise.
  2807. * tree-optimize.c: Likewise.
  2808. * tree-pretty-print.c: Likewise.
  2809. * tree-ssa-ccp.c: Likewise.
  2810. * tree-ssa-dom.c: Likewise.
  2811. * tree-ssa.c: Likewise.
  2812. * tree-tailcall.c: Likewise.
  2813. * tree.def: Likewise.
  2814. * tree.h: Likewise.
  2815. 2003-12-18 Jason Merrill <jason@redhat.com>
  2816. PR c++/12453
  2817. * c-simplify.c (stmt_expr_last_stmt): Split out from...
  2818. (gimplify_stmt_expr): Here.
  2819. * c-common.h: Declare it.
  2820. 2003-12-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  2821. * et-forest.h (et_forest_create, et_forest_delete,
  2822. et_forest_add_node, et_forest_add_edge, et_forest_remove_node,
  2823. et_forest_remove_edge, et_forest_parent,
  2824. et_forest_common_ancestor, et_forest_node_value,
  2825. et_forest_enumerate_sons): Declarations removed.
  2826. (struct et_node): New.
  2827. (et_new_tree, et_free_tree, et_set_father, et_split, et_nca,
  2828. et_below): Declare.
  2829. * et-forest.c (struct et_forest_occurrence, struct et_forest,
  2830. struct et_forest_node): Removed.
  2831. (et_forest_create, et_forest_delete,
  2832. et_forest_add_node, et_forest_add_edge, et_forest_remove_node,
  2833. et_forest_remove_edge, et_forest_parent,
  2834. et_forest_common_ancestor, et_forest_node_value,
  2835. et_forest_enumerate_sons, splay, remove_all_occurrences,
  2836. find_leftmost_node, find_rightmost_node, calculate_value): Removed.
  2837. (struct et_occ): New.
  2838. (et_nodes, et_occurences): New.
  2839. (set_depth, set_depth_add, set_prev, set_next, et_recomp_min,
  2840. et_check_occ_sanity, et_check_sanity, et_check_tree_sanity,
  2841. record_path_before_1, record_path_before, check_path_after_1,
  2842. check_path_after, et_splay, et_new_occ, et_new_tree,
  2843. et_free_tree, et_set_father, et_split, et_nca, et_below): New.
  2844. * basic-block.h (struct basic_block_def): New field dom.
  2845. (struct dominance_info): Type removed.
  2846. (calculate_dominance_info, free_dominance_info,
  2847. nearest_common_dominator, set_immediate_dominator,
  2848. get_immediate_dominator, dominated_by_p, get_dominated_by,
  2849. add_to_dominance_info, delete_from_dominance_info,
  2850. recount_dominator, redirect_immediate_dominators,
  2851. iterate_fix_dominators, verify_dominators): Declarations
  2852. changed.
  2853. (enum dom_state): New.
  2854. (dom_computed): New variable.
  2855. (first_dom_son, next_dom_son): Declare.
  2856. * dominance.c (struct dominance_info): Removed.
  2857. (BB_NODE, SET_BB_NODE): Removed.
  2858. (calculate_dominance_info, free_dominance_info,
  2859. nearest_common_dominator, set_immediate_dominator,
  2860. get_immediate_dominator, dominated_by_p, get_dominated_by,
  2861. add_to_dominance_info, delete_from_dominance_info,
  2862. recount_dominator, redirect_immediate_dominators,
  2863. iterate_fix_dominators, verify_dominators,
  2864. debug_dominance_info): Work over new datastructure. Access
  2865. dominance datastructures through CFG.
  2866. (assign_dfs_numbers, compute_dom_fast_query, first_dom_son,
  2867. next_dom_son): New.
  2868. * tree-cfg.c (pdom_info): Variable removed.
  2869. (create_bb): Add the block to the dominance information.
  2870. (cleanup_tree_cfg): Let updating of the dominance on the
  2871. individual passes.
  2872. (remove_bb): Don't handle pdom.
  2873. (cleanup_control_expr_graph, tree_make_forwarder_block,
  2874. thread_jumps): Invalidate the dominators.
  2875. (tree_split_edge): Update the dominators.
  2876. (compute_dominance_frontiers_1, compute_dominance_frontiers,
  2877. tree_verify_flow_info, tree_loop_optimizer_init): Use the new
  2878. interface to dominators.
  2879. * domwalk.c (walk_dominator_tree): Do not use dom_children.
  2880. * tree-flow-inline.h (add_dom_child, remove_dom_child,
  2881. clear_dom_children, dom_children): Removed.
  2882. * tree-flow.h (struct bb_ann_d): Dom_children field removed.
  2883. (add_dom_child, dom_children, build_dominator_tree): Declaration
  2884. removed.
  2885. (compute_dominance_frontiers): Declaration changed.
  2886. * tree-optimize.c (optimize_function_tree): Free dominance
  2887. information in the end.
  2888. * tree-ssa-dom.c (tree_ssa_dominator_optimize,
  2889. dom_opt_finalize_block): Do not use dom_children.
  2890. * tree-ssa-pre.c (fast_a_dominates_b, build_dfs_id_array_1,
  2891. build_dfs_id_array): Removed.
  2892. (pre_idom, dfs_id, dfs_id_last): Variables removed.
  2893. (build_dfn_array): Do not use dom_children.
  2894. (eref_compare, load_modified_phi_result, rename_1, reaching_def,
  2895. finalize_1, collect_expressions, tree_perform_ssapre): Use the
  2896. new interface to the dominance information.
  2897. * tree-ssa.c (struct mark_def_sites_global_data): Idom field
  2898. removed.
  2899. (set_livein_block, verify_use, verify_phi_args,
  2900. rewrite_into_ssa, mark_def_sites, verify_ssa): Use the new
  2901. interface to the dominance information.
  2902. (build_dominator_tree): Removed.
  2903. * tree-tailcall.c (tree_optimize_tail_calls): Invalidate
  2904. dominance information.
  2905. * bt-load.c (dom): Variable removed.
  2906. (augment_live_range, combine_btr_defs, migrate_btr_def,
  2907. migrate_btr_defs, branch_target_load_optimize): Updated for the
  2908. new interface for dominance information.
  2909. * cfglayout.c (copy_bbs): Removed loops argument. Updated for
  2910. the new interface for dominance information.
  2911. * cfglayout.h (copy_bbs): Declaration changed.
  2912. * cfgloop.c (flow_loop_pre_header_find, flow_loops_cfg_dump,
  2913. flow_loop_scan, canonicalize_loop_headers, flow_loops_find): Updated
  2914. for the new interface for dominance information.
  2915. (flow_loop_scan): Loops argument removed.
  2916. (flow_loops_free): Don't release dominators.
  2917. * cfgloop.h (struct cfg): Dom field removed.
  2918. (flow_loop_scan, loop_split_edge_with, simple_loop_p,
  2919. just_once_each_iteration_p, split_loop_bb): Declaration changed.
  2920. * cfgloopanal.c (simple_loop_exit_p, simple_increment,
  2921. just_once_each_iteration_p, simple_loop_p): Remove loops argument.
  2922. Updated for the new interface for dominance information.
  2923. * cfgloopmanip.c (remove_bbs, find_path, create_preheader,
  2924. split_loop_bb, loopify, duplicate_loop_to_header_edge,
  2925. force_single_succ_latches, loop_split_edge_with): Ditto.
  2926. (create_loop_notes): Free the dominators.
  2927. * gcse.c (dominators): Variable removed.
  2928. (free_code_hoist_mem, compute_code_hoist_data, hoist_code):
  2929. Updated for the new interface for dominance information.
  2930. * ifcvt.c (post_dominators): Variable removed.
  2931. (mark_loop_exit_edges, merge_if_block, find_if_header,
  2932. find_cond_trap, find_if_case_1, find_if_case_2, if_convert):
  2933. Updated for the new interface for dominance information.
  2934. * loop-init.c (rtl_loop_optimizer_init,
  2935. rtl_loop_optimizer_finalize): Ditto.
  2936. * loop-unroll.c (decide_peel_simple, decide_peel_once_rolling,
  2937. decide_peel_completely, decide_unroll_stupid,
  2938. decide_unroll_constant_iterations,
  2939. decide_unroll_runtime_iterations): Loops argument removed.
  2940. Updated for the new interface for dominance information.
  2941. (unroll_and_peel_loops, peel_loops_completely,
  2942. unroll_loop_runtime_iterations): Updated for the new interface for
  2943. dominance information.
  2944. * loop-unswitch.c (may_unswitch_on_p, unswitch_loops,
  2945. unswitch_single_loop, unswitch_loop): Updated for the new
  2946. interface for dominance information.
  2947. * predict.c (process_note_predictions, process_note_prediction,
  2948. estimate_probability, note_prediction_to_br_prob): Ditto.
  2949. * sched-rgn.c (find_rgns, init_regions): Ditto.
  2950. * toplev.c (rest_of_handle_branch_prob): Free the dominators.
  2951. 2003-12-18 Jeff Law <law@redhat.com>
  2952. * tree-ssa-dom.c (edges_to_redirect, redirection_targets): Merged
  2953. into a single varray "redirection_edges".
  2954. (tree_ssa_dominator_optimize): Twiddle initialization, finalization
  2955. and accessors to redirection information based on combining varrays.
  2956. Get the threading destination from the saved edge rather than from a
  2957. saved block. Mark variables appearing in PHIs at the jump thread
  2958. destination to be taken out of SSA form.
  2959. (thread_across_edge): Save the edge into the destination block
  2960. rather than the destination block itself. Twiddle based on
  2961. combining varrays of jump threading information.
  2962. * tree-flow.h (tree_block_forwards_to): Returns an edge rather than
  2963. a block.
  2964. * tree-cfg.c (tree_block_forwards_to): Return the edge leading to
  2965. the target block rather than the target block itself.
  2966. 2003-12-18 Daniel Berlin <dberlin@dberlin.org>
  2967. * tree-dfa.c (get_memory_tag_for): Don't put things with different
  2968. points-to sets in the same memory tag.
  2969. 2003-12-18 Jan Hubicka <jh@suse.cz>
  2970. * c-common.c (handle_nonnull_attribute, check_function_nonnull):
  2971. Initialize arg_num.
  2972. * c-format.c (handle_format_attribute): Initialize format_num.
  2973. * rtlanal.c (get_related_value): Initialize get_jump_table_offset
  2974. 2003-12-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  2975. * stmt.c (expand_start_loop, expand_loop_continue_here,
  2976. expand_end_loop): Don't create loop notes.
  2977. 2003-12-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  2978. Jeff Law <law@redhat.com>
  2979. * tree-cfg.c (tree_node_shared_p): Explicitly allow sharing of
  2980. CST nodes.
  2981. * tree-simple.c (is_gimple_rhs): Allow CST nodes.
  2982. (is_gimple_min_invariant): Reject constants with TREE_OVERFLOW set.
  2983. * tree-ssa-ccp (visit_assignment): Test is_gimple_min_invariant
  2984. after munging bitfields.
  2985. * tree-ssa-dom.c (record_equivalences_from_stmt): Similarly.
  2986. 2003-12-17 Jan Hubicka <jh@suse.cz>
  2987. Based on patch by Dale Johannesen
  2988. * expr.c (MOVE_RATIO, CLEAR_RATIO): Move to ...
  2989. * expr.h (MOVE_RATIO, CLEAR_RATIO): ... here
  2990. 2003-12-17 Jan Hubicka <jh@suse.cz>
  2991. * Makefile.in (sibcall.o): Kill.
  2992. (tree-tailcall.o): Add except.h dependency
  2993. * sibcall.c: Kill.
  2994. (purge_reg_equiv_notes, purge_mem_unchanging_flag): Move to ...
  2995. * calls.c (purge_reg_equiv_notes, purge_mem_unchanging_flag) ... here.
  2996. (expand_call): Do not produce placeholders; do not deal with tail
  2997. recursion; set tail_call_emit.
  2998. (fixup_tail_calls): New.
  2999. * expr.h (fixup_tail_calls): Declare.
  3000. * toplev.c (rest_of_handle_sibling_calls): Kill.
  3001. (rest_of_compialtion): Do not use rest_of_handle_sibling_calls;
  3002. call fixup_tail_calls.
  3003. * tree-dump.c (dump_files): Add tail2
  3004. * tree-flow.h (tree_optimize_tail_calls): Update prototype.
  3005. * tree-optimize.c (optimize_function_tree): Do tail optimization twice.
  3006. * tree-tailcall.c: Inlucde except.h
  3007. (suitable_for_tail_call_opt_p): New.
  3008. (optimize_tail_call): Add opt_tailcalls argument; optimize tailcalls.
  3009. (tree_optimize_tail_calls): Add opt_tailcalls/pass arguments.
  3010. * tree.h (CALL_EXPR_TAILCALL): New.
  3011. (tree_dump_index): Add tail2
  3012. * function.h (struct function): Add tail_call_emit field.
  3013. 2003-12-17 Jan Hubicka <jh@suse.cz>
  3014. * tree-inline.c (estimate_num_insns_1): Check that all nodes are
  3015. known; add missing nodes; fix MODIFY_EXPR
  3016. 2003-12-16 Jason Merrill <jason@redhat.com>
  3017. PR middle-end/12920
  3018. * stor-layout.c (layout_type): Just return if type is
  3019. error_mark_node.
  3020. * c-decl.c (grokdeclarator): Immediately layout an
  3021. ARRAY_TYPE used in a pointer-to-array declarator.
  3022. 2003-12-16 Diego Novillo <dnovillo@redhat.com>
  3023. * tree-dfa.c (may_alias_p): If VAR and PTR are pointers with the
  3024. same alias set, return false.
  3025. (get_memory_tag_for): Group based on alias set classes, not on
  3026. conflicting alias sets.
  3027. * tree-must-alias.c (promote_var): Don't bring aliases over when
  3028. all the may-aliases of a non-promotable variable are promoted.
  3029. 2003-12-16 Andrew MacLeod <amacleod@redhat.com>
  3030. * tree-flow-inline.h (free_vuse, free_vdefs): Moved to
  3031. tree-ssa-operands.c
  3032. (get_def_ops, get_use_ops, get_vdef_ops, get_vuse_ops): Use the new
  3033. more direct structure pointer.
  3034. (get_use_op_ptr, get_def_op_ptr): Cast is no longer necessary.
  3035. * tree-flow.h (struct stmt_ann_d): Replace operands and voperands
  3036. pointers with pointers directly to the operand types.
  3037. * tree-ssa-dom.c (cprop_into_stmt): Use new stmt based interface to
  3038. free virtual operands. Check virtual bases of both VUSE and VDEF.
  3039. * tree-ssa-operands.c (struct voperands_d): Declare here, used only
  3040. for previous_vops during stmt operand construction.
  3041. (struct vecmanage_d, vecmanage_add_segmen, vecmanage_add_special,
  3042. vecmanage_init, vecmanage_tree_ptr_init, vecmanage_fini, check_free,
  3043. vecmanage_new_vector, vecmanage_new_tree_ptr_vector,
  3044. vecmanage_free_vector): Remove.
  3045. (allocate_ssa_op_vec, free_ssa_op_vec, allocate_ssa_virtual_op_vec,
  3046. allocate_operands_t, allocate_voperands_t): Remove.
  3047. (finalize_new_ssa_operands, inalize_new_ssa_virtual_operand): Remove.
  3048. (struct freelist_d): New. List of free operand structures.
  3049. (check_optype_freelist): New. Choose memory from freelist, if available.
  3050. (add_optype_freelist): New. Add structure to freelist, if appropriate.
  3051. (allocate_def_optype): New. Allocate a def operand list from GC.
  3052. (allocate_use_optype): New. Allocate a useoperand list from GC.
  3053. (allocate_vdef_optype): New. Allocate a vdef operand list from GC.
  3054. (allocate_vuse_optype): New. Allocate a vuse operand list from GC.
  3055. (free_uses, free_defs, free_vuses, free_vdefs): Use GC and the freelist.
  3056. (remove_vuses, remove_vdefs): New. External interface to remove virtual
  3057. operands.
  3058. (init_ssa_operands, fini_ssa_operands): Ensure the free list is empty.
  3059. (finalize_ssa_defs, finalize_ssa_use, finalize_ssa_vdefs,
  3060. finalize_ssa_vuses): Use new direct pointers from the stmt annotation.
  3061. (append_vdef, append_vuse): No need to hack prev_vops pointer now.
  3062. (get_stmt_operands): use new freeing interface, keep previous vops in
  3063. their own local structure for now, passing its address around.
  3064. * tree-ssa-operands.h (struct def_optype_d, struct use_optype_d,
  3065. struct vdef_optype_d, struct vuse_optype_d): Implement as a single
  3066. dynamically allocated structure.
  3067. (struct operands_d, struct operands_d): Remove.
  3068. * tree-ssa-pre.c (subst_phis): Remove virtual operands using new funcs.
  3069. 2003-12-16 Jan Hubicka <jh@suse.cz>
  3070. * tree-cfg.c (verify_addr_expr): Rename to ....
  3071. (verify_expr): ... this one; check that no SSA names are on
  3072. freelist.
  3073. (verify_stmt, verify_stmts): Update calls of verify_addr_expr.
  3074. Revert until initializers are made language independent:
  3075. * cgraphunit.c (record_call_1): Do not call analyze_expr hook
  3076. * langhooks-def.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Kill.
  3077. (LANG_HOOKS_CALLGRAPH_INITIALIZER): Update.
  3078. * longhooks.h (lang_hooks_for_callgraph): Kill analyze_expr.
  3079. 2003-12-16 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  3080. * tree-pretty-print.c (dump_bb_header): Show block number when
  3081. there is no label.
  3082. (pp_cfg_jump): Show labels in addition to block numbers.
  3083. (dump_generic_bb_buff): Always call dump_bb_header.
  3084. 2003-12-16 Jan Hubicka <jh@suse.cz>
  3085. * cgraphunit.c (cgraph_remove_unreachable_nodes): Fix typo;
  3086. improve comments; cleanup linked list mantenance.
  3087. 2003-12-15 Diego Novillo <dnovillo@redhat.com>
  3088. * tree-sra.c (can_be_scalarized_p): Reject volatile variables.
  3089. * sibcall.c (skip_copy_to_return_value): Initialize 'hardret' and
  3090. 'softret'.
  3091. 2003-12-16 Jan Hubicka <jh@suse.cz>
  3092. * cgraph.c (cgraph_remove_node): Ignore DECL_EXTERNAL clones.
  3093. * cgraphunit.c (verify_cgraph_node): Do not insist on unemmited extern
  3094. inline functions to be valid.
  3095. (cgraph_finalize_compilation_unit): Fix ordering.
  3096. (cgraph_mark_functions_to_output): Do not insist on DECL_EXTERNAL
  3097. nodes to be reclaimed.
  3098. (cgraph_remove_unreachable_nodes): New function.
  3099. (cgraph_decide_inlining): use it.
  3100. 2003-12-15 Andrew MacLeod <amacleod@redhat.com>
  3101. * Makefile.in (TREE_FLOW_H): Add dependence on tree-ssa-operands.h
  3102. (OBJS-common): Add tree-ssa-operands.o
  3103. (tree-ssa-operands.o): Add dependencies.
  3104. (GTFILES): Add tree-ssa-operands.[ch].
  3105. * tree-dfa.c (get_stmt_operands, get_expr_operands, add_stmt_operand,
  3106. note_addressable, add_def, add_use, add_vde, add_vuse,
  3107. add_call_clobber_ops, add_call_read_ops): Moved to tree-ssa-operands.c.
  3108. (compute_immediate_uses_for_stmt): Use new optypes interface.
  3109. (cleanup_operand_arrays): Delete.
  3110. (collect_dfa_stats_r): Use new optypes interface.
  3111. (get_call_flags): Moved to tree-ssa-operands.c.
  3112. (vdefs_disappeared_p, mark_new_vars_to_rename): Use optypes interface.
  3113. * tree-flow-inline.h (def_ops, use_ops, vdef_ops, vuse_ops): Use new
  3114. optypes.
  3115. (free_vuses): New. Clear and release vuses.
  3116. (free_vdefs): New. Clear and release vdefs.
  3117. (get_use_ops_ptr): New. Get address of a use op.
  3118. (get_def_ops_ptr): New. Get address of a use op.
  3119. (get_vdef_result_ptr): New. Get address of a use op.
  3120. (get_vdef_op_ptr): New. Get address of a use op.
  3121. (get_vuse_op_ptr): New. Get address of a use op.
  3122. (start_ssa_stmt_operands): New. Entry point to start processing stmt
  3123. operands.
  3124. * tree-flow.h (struct operands_d, struct voperands_d): Move to
  3125. tree-ssa-operands.h
  3126. (struct stmt_ann_d): Add GTY markers to operands.
  3127. * tree-pretty-print.c (dump_vops): Use optypes interface.
  3128. * tree-sra.c (create_scalar_copies): Use optypes interface.
  3129. (scalarize_structures, scalarize_modify_exp): Use optypes interface.
  3130. * tree-ssa-ccp.c (visit_stmt, ccp_fold, initialize, replace_uses_in,
  3131. likely_value, set_rhs): Use optypes interface.
  3132. * tree-ssa-dce.c (find_useful_stmts, stmt_useful_p, process_worklist):
  3133. Use optypes interface.
  3134. * tree-ssa-dom.c (thread_across_edge, thread_jumps_walk_stmts): Use
  3135. optypes interface.
  3136. (cprop_into_stmt): Rewrite using new interface.
  3137. (eliminate_redundant_computations, record_equivalences_from_stmt,
  3138. optimize_stmt, avail_expr_hash, avail_expr_eq): Use optypes interface.
  3139. * tree-ssa-live.c (create_ssa_var_map, calculate_live_on_entry,
  3140. build_tree_conflict_graph,register_ssa_partitions_for_vars): Use
  3141. optypes interface.
  3142. * tree-ssa-pre.c (names_match_p, maybe_find_rhs_use_for_var,
  3143. expr_phi_insertion, same_e_version_real_occ_real_occ, opnum_of_phi,
  3144. generate_expr_as_of_bb, generate_vops_as_of_bb, subst_phis,
  3145. load_modified_real_occ_real_occ, same_e_version_phi_result, can_insert,
  3146. get_default_def, reaching_def, process_left_occs_and_kills,
  3147. collect_expressions): Use optypes interface.
  3148. * tree-ssa.c (mark_def_sites, check_replaceable, find_replaceable_in_bb,
  3149. dump_replaceable_exprs, rewrite_trees, verify_ssa, rewrite_stmt): Use
  3150. optypes interface.
  3151. (init_tree_ssa): Initialize new operand data structures.
  3152. (delete_tree_ssa): Free new operand structures.
  3153. * tree.h (VDEF_RESULT, VDEF_OP, NUM_VDEFS): Move to tree-ssa-operands.h.
  3154. * tree-ssa-operands.h: New file.
  3155. (struct def_optype_d): New. Structure for stmt defs.
  3156. (struct use_optype_d): New. Structure for stmt uses.
  3157. (struct vdef_optype_d): New. Structure for stmt vdefs.
  3158. (struct vuse_optype_d): New. Structure for stmt vuses.
  3159. (USE_OPS, STMT_USE_OPS, NUM_USES, USE_OP_PTR, USE_OP): Macros to
  3160. access stmt uses.
  3161. (DEF_OPS, STMT_DEF_OPS, NUM_DEFS, DEF_OP_PTR, DEF_OP): Macros to
  3162. access stmt defs.
  3163. (VDEF_OPS, STMT_VDEF_OPS, NUM_VDEFS, VDEF_RESULT_PTR, VDEF_RESULT,
  3164. VDEF_OP_PTR, VDEF_OP): Macros to access stmt vdefs.
  3165. (VUSE_OPS, STMT_VUSE_OPS, NUM_VUSES, VUSE_OP_PTR, VUSE_OP): Macros to
  3166. access stmt vuses.
  3167. (struct operands_d, struct voperands_d): moved from tree-dfa.c.
  3168. * tree-ssa-operands.c: New file.
  3169. (build_defs, build_uses, build_vdefs, build_vuses): New static varrays.
  3170. (struct vecmanage_d): New. Struct to manage non-GC vectors.
  3171. (vecmanage_add_segment): New. Add a new segment to a vector manager.
  3172. (vecmanage_add_special): New. Add a large vector to the special list.
  3173. (vecmanage_init): Initialize a vector manager.
  3174. (vecmanage_tree_ptr_init): New. Initialize a vector manager for tree *.
  3175. (vecmanage_fini): New. Release vector manager memory.
  3176. (check_free): New. Look for free memory in the vector maanger.
  3177. (vecmanage_new_vector): New. Allocate a vector.
  3178. (vecmanage_new_tree_ptr_vector): New. Allocate a vector of 'tree *'.
  3179. (vecmanage_free_vector): New. Free a vector.
  3180. (free_ssa_op_vec): New. Free an ssa operand's memory.
  3181. (allocate_ssa_op_vec): New. Allocate a vector for use/defs.
  3182. (allocate_ssa_virtual_op_vec): New. Allocate a vector for vuse/vdefs.
  3183. (allocate_operands_t): New. Allocate an operand structure.
  3184. (allocate_voperands_t): New. Allocate a virtual operand structure.
  3185. (free_uses): New. Clear and release uses.
  3186. (free_defs): New. Clear and release defs.
  3187. (init_ssa_operands): New. Initialize ssa operand management.
  3188. (fini_ssa_operands): New. Cleanup ssa operand management.
  3189. (finalize_new_ssa_operands): New. Commit current operands.
  3190. (finalize_new_ssa_virtual_operands): New. Commit current virtual ops.
  3191. (finalize_ssa_defs): New. Commit and verify stmt definitions.
  3192. (finalize_ssa_uses): New. Commit and verify stmt uses.
  3193. (finalize_ssa_vdefs): New. Commit and verify stmt virtual definitions.
  3194. (finalize_ssa_vuses): New. Commit and verify stmt virtual uses.
  3195. (finalize_ssa_stmt_operands): New. Commit all stmt operands.
  3196. (verify_start_operands): New. Verify build mechanism is ready for a new
  3197. stmt.
  3198. (append_def): Renamed from add_def, and moved from tree-dfa.c.
  3199. (append_use): Renamed from add_def, and moved from tree-dfa.c.
  3200. (append_vdef): Renamed from add_def, and moved from tree-dfa.c.
  3201. (append_vuse): Renamed from add_def, and moved from tree-dfa.c.
  3202. (add_vuse): New. Entry point to add a vuse to a stmt.
  3203. (get_call_flags): Moved from tree-dfa.c
  3204. (get_stmt_operands, get_expr_operands, add_stmt_operand): Moved from
  3205. tree-dfa.c, and use new optype interface.
  3206. (note_addressabe, add_call_clobber_ops, add_call_read_ops): Moved from
  3207. tree-dfa.c
  3208. 2003-12-15 Diego Novillo <dnovillo@redhat.com>
  3209. * tree-optimize.c (optimize_function_tree): Call BITMAP_XFREE.
  3210. 2003-12-15 Diego Novillo <dnovillo@redhat.com>
  3211. PR optimization/12747
  3212. * tree-cfg.c (verify_addr_expr): Simplify predicates.
  3213. * tree-must-alias.c (addresses_needed): Declare as file local.
  3214. (can_be_promoted): New.
  3215. (tree_compute_must_alias): Call it.
  3216. Remove promoted variables from call_clobbered_vars.
  3217. (find_addressable_vars): Update comment.
  3218. Remove argument. Update callers.
  3219. (promote_var): Always clear TREE_ADDRESSABLE.
  3220. Don't remove promoted variables from call_clobbered_vars.
  3221. If the promoted variable is in the may-alias set of a
  3222. non-promotable variable, copy its alias set into the alias set of
  3223. the non-promotable variable.
  3224. (find_variable_in): Update comment.
  3225. * tree-sra.c (can_be_scalarized_p): Reject structures with
  3226. __complex__ fields in them.
  3227. 2003-12-15 Diego Novillo <dnovillo@redhat.com>
  3228. Jason Merrill <jason@redhat.com>
  3229. PR optimization/12747
  3230. * Makefile.in (tree-simple.o): Add dependency on bitmap.h and
  3231. $(GGC_H).
  3232. (GTFILES): Add tree-simple.c.
  3233. * tree-simple.c: Include ggc.h and bitmap.h.
  3234. (is_gimple_non_addressable_1): Remove. Update all callers.
  3235. (types_checked): New local variable.
  3236. (types_in_memory): New local variable.
  3237. (struct_needs_to_live_in_memory): New.
  3238. (needs_to_live_in_memory): New.
  3239. (is_gimple_reg): Call it.
  3240. (is_gimple_non_addressable): Call it.
  3241. (is_gimple_call_clobbered): Call it.
  3242. * tree-simple.h (needs_to_live_in_memory): Declare.
  3243. 2003-12-14 Andreas Jaeger <aj@suse.de>
  3244. * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Handle
  3245. GNU F95.
  3246. 2003-12-14 Jan Hubicka <jh@suse.cz>
  3247. * cgraphunit.c (cgraph_expand_function): Release function body when no
  3248. longer needed.
  3249. (lookup_recursive_calls): New function.
  3250. (cgraph_decide_recursive_inlining): Likewise.
  3251. (cgraph_decide_inlining_of_small_functions): Do recursive inlining.
  3252. * tree-inline.c: Include function.h
  3253. (copy_body): Choose saved body for recursive inlining.
  3254. (initialize_inlined_parameters): Likewise.
  3255. (expand_call_inline): Do not verify nodes when recursivly inlining,
  3256. insert ret_label into decl map.
  3257. * params.def (PARAM_MAX_INLINE_INSNS_RECURSIVE,
  3258. PARAM_MAX_INLINE_INSNS_RECURSIVE_AUTO,
  3259. PARAM_MAX_INLINE_RECURSIVE_DEPTH,
  3260. PARAM_MAX_INLINE_RECURSIVE_DEPTH_AUTO): New argument.
  3261. * invoke.texi (max-inline-insns-recursive, max-inline-recursive-depth):
  3262. Document.
  3263. * Makefile.in (tree-inline.o): Include function.h.
  3264. 2003-12-14 Jan Hubicka <jh@suse.cz>
  3265. * cgraphunit.c (record_call_1): Do not call analyze_expr hook
  3266. * langhooks-def.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Kill.
  3267. (LANG_HOOKS_CALLGRAPH_INITIALIZER): Update.
  3268. * longhooks.h (lang_hooks_for_callgraph): Kill analyze_expr.
  3269. 2003-12-13 Jan Hubicka <jh@suse.cz>
  3270. * timevar.def (TV_TREE_STMT_VERIFY, TV_CFG_VERIFY, TV_CGRAPH_VERIFY):
  3271. New timers.
  3272. * tree-cfg.c (verify_stmts): Push/pop timevar.
  3273. * cfg.c: Include timevar.h
  3274. (verify_flow_info): Push/pop timevar.
  3275. * Makefile.in (cfg.o): Add dependnecy on TIMEVARS
  3276. * cgraph.c (cgraph_create_edge): Sanity check for duplicates;
  3277. initialize aux.
  3278. (cgraph_remove_node): Decrease cgraph_n_nodes; do not clear
  3279. DECL_SAVED_TREE when dumping.
  3280. (cgraph_dump_node): Break out from ...; print more information.
  3281. (cgraph_dump): ... here.
  3282. * cgraph.h (cgraph_node): Add aux field.
  3283. (dump_cgraph_node, verify_cgraph, verify_cgraph_node): Declare.
  3284. (cgraph_mark_inline_edge): Declare
  3285. * cgraphunit.c (error_found): New static variable.
  3286. (verify_cgraph_node_1): New static function.
  3287. (verify_cgraph_node, verify_cgraph): New global function.
  3288. (cgraph_expand_function): More sanity checks.
  3289. (cgraph_clone_inline_nodes): Destructivly clone DECL_EXTERNAL nodes.
  3290. (cgraph_mark_inline_edge): Make global.
  3291. (cgraph_decide_inlining): Remove extern inline functions never inlined.
  3292. (cgraph_decide_inlining_incrementally): Verify that function body is
  3293. still present.
  3294. (expand_all_functions): Verify that all nodes are reachable.
  3295. (cgraph_optimize): Verify cgraph and memory management.
  3296. * tree-inline.c (copy_body_r): All edges must be present.
  3297. (expand_call_inline): Sanity check newly created edges and nodes
  3298. being inlined.
  3299. (optimize_inline_calls): Sanity check that we've inlined everything.
  3300. * tree-optimize.c (tree_rest_of_compilation): Clone functions inlined
  3301. into cloned node.
  3302. 2003-12-13 Jan Hubicka <jh@suse.cz>
  3303. * tree-flow.h (tree_ssa_useless_type_conversion_1): Declare.
  3304. * tree-flow.c (tree_ssa_useless_type_conversion_1): Break out from
  3305. from...; allow complex types whose subtypes match.
  3306. (tree_ssa_useless_type_conversion): ... here.
  3307. 2003-12-12 Jeff Law <law@redhat.com>
  3308. * tree-ssa-dom.c (optimize_stmt): Don't call cleanup_control_expr
  3309. here. Instead just note that we need to cleanup the cfg (which
  3310. will DTRT).
  3311. * timevar.def (TV_TREE_SSA_THREAD_JUMPS): Kill.
  3312. * tree-dump.c (dump_files): Kill .thread dump.
  3313. * tree.h (TDI_thread_jumps): Kill.
  3314. * tree-flow.h (tree_ssa_dominator_thread_jumps): Kill prototype.
  3315. * tree-optimize.c (optimize_function_tree): Kill call to
  3316. tree_ssa_dominator_thread_jumps.
  3317. * tree-ssa-dom.c (thread_through_phis): Kill. We no longer need
  3318. to restrict threading through PHIs.
  3319. (tree_ssa_dominator_thread_jumps): Kill.
  3320. (tree_ssa_domiantor_optimize_1): Fold back into
  3321. tree_ssa_dominator_optimize.
  3322. (tree_ssa_dominator_optimize): Mark back edges in the flow graph.
  3323. Kill code which conditionalized the walk_tree callbacks based
  3324. on thread_through_phis. When threading jumps, reorganize code
  3325. so that we can take the affected variables out of SSA form.
  3326. Mark new variables created by out-of-ssa code as needing to be
  3327. rewritten.
  3328. (thread_across_edge): Always allow threading through phis.
  3329. (thread_jumps_walk_stmts): Kill.
  3330. * tree-ssa.c (create_temp): When we create a new temporary, make
  3331. sure to put it into referenced_vars, give it an ID number and
  3332. a suitable mem_tag.
  3333. (eliminate_build): If we encounter a PHI argument which is an
  3334. SSA_VAR we are not rewriting out of SSA form, then just treat
  3335. it like a constant.
  3336. (rewrite_vars_out_of_ssa): New function.
  3337. * tree-flow.h (rewrite_vars_out_of_ssa): Prototype.
  3338. * tree-ssa-live.c (register_ssa_partitions_for_vars): New function.
  3339. * tree-ssa-live.h (register_ssa_partitions_for_vars): Prototype.
  3340. 2003-12-12 Jan Hubicka <jh@suse.cz>
  3341. * tree-inline.c (remap_decl): Avoid invalid sharing.
  3342. * cp-tree.h (optimize_function): Kill.
  3343. * optimize.c (optimize_function): Kill.
  3344. * semantics.c (expand_body): Do not call optimize_function.
  3345. 2003-12-12 Jan Hubicka <jh@suse.cz>
  3346. * cgraphunit.c (cgraph_optimize): Do not decide inlining when not
  3347. inlining
  3348. 2003-12-11 Jan Hubicka <jh@suse.cz>
  3349. * tree-inline.c (initialize_inlined_parameters): Disable
  3350. constant propagation for non-gimple-min-invariant when
  3351. preserving gimple form.
  3352. 2003-12-11 Jeff Law <law@redhat.com>
  3353. * tree-ssa-ccp.c (widen_bitfield): Clear out unwanted high bits
  3354. even if the field's type is unsigned.
  3355. * tree-ssa-dom.c (record_equivalences_from_stmt): When creating
  3356. equivalences from stores, be more careful about non-constant
  3357. stores to bitfields.
  3358. 2003-12-11 Diego Novillo <dnovillo@redhat.com>
  3359. * opts.c (decode_options): Do not enable the tree loop optimizer by
  3360. default.
  3361. * tree-ssa-loop.c (tree_ssa_loop_opt): Remove ENABLE_CHECKING
  3362. guards.
  3363. 2003-12-10 Richard Henderson <rth@redhat.com>
  3364. * builtins.c (expand_builtin_profile_func): New.
  3365. (expand_builtin): Use it.
  3366. * builtins.def (BUILT_IN_PROFILE_FUNC_ENTER): New.
  3367. (BUILT_IN_PROFILE_FUNC_EXIT): New.
  3368. * function.c (expand_function_start, expand_function_end): Don't
  3369. do function instrumentation here.
  3370. * gimplify.c (gimplify_function_tree): Do it here.
  3371. * c-opts.c (c_common_post_options): Don't ever use rtl inlining.
  3372. 2003-12-10 Diego Novillo <dnovillo@redhat.com>
  3373. * ifcvt.c (dead_or_predicable): Initialize local variable
  3374. 'earliest'.
  3375. * tree-cfg.c (verify_stmt): Fix typo.
  3376. * tree-ssa-dom.c (propagate_value): New local function.
  3377. (cprop_into_stmt): Call it.
  3378. (cprop_into_phis): Call it.
  3379. (eliminate_redundant_computations): Call it.
  3380. 2003-12-10 Dale Johannesen <dalej@apple.com>
  3381. * tree-dfa.c (compute_alias_sets): Don't try to make
  3382. GLOBAL_VAR alias itself.
  3383. 2003-12-08 Steven Bosscher <stevenb@suse.de>
  3384. * tree-must-alias.c (tree_compute_must_alias): Use
  3385. num_call_clobbered_vars and call_clobbered_var() instead of
  3386. poking in the call_clobbered_vars varray directly.
  3387. 2003-12-11 Jan Hubicka <jh@suse.cz>
  3388. * cgraph.c (cgraph_function_possibly_inlined_p): Fix syntax error on
  3389. gcc-2.95.
  3390. 2003-12-10 Diego Novillo <dnovillo@redhat.com>
  3391. Revert
  3392. 2003-12-07 Richard Henderson <rth@redhat.com>
  3393. * c-common.c (c_address_looks_like_offsetof): New.
  3394. * c-common.h (c_address_looks_like_offsetof): Declare.
  3395. * c-typeck.c (build_unary_op) <ADDR_EXPR>: Use it. Don't lower
  3396. address references not destined for offsetof.
  3397. (c_expand_return): Only look inside ARRAY_REF and COMPONENT_REF
  3398. when looking for returning address of local variable.
  3399. * expr.c (expand_expr_1): Don't dereference size
  3400. of unbounded arrays.
  3401. * gimplify.c (gimplify_addr_expr): Only fold
  3402. address of variable size array elements.
  3403. * tree-simple.c (is_gimple_min_invariant): Also check
  3404. is_gimple_variable before disallowing offset address for type.
  3405. * tree-ssa-ccp.c (maybe_fold_offset_to_aggregate_ref): New.
  3406. (maybe_fold_offset_to_component_ref): Use it.
  3407. (maybe_fold_stmt_indirect, maybe_fold_stmt_plus): Likewise.
  3408. (maybe_fold_offset_to_array_ref): Likewise.
  3409. Don't fail for division remainder non-zero.
  3410. * varasm.c (initializer_constant_valid_p) <ADDR_EXPR>: Use
  3411. handled_component_p and look inside references.
  3412. <MINUS_EXPR>: Always look past widening casts.
  3413. 2003-12-09 Jan Hubicka <jh@suse.cz>
  3414. * cgraph.c (cgraph_inline_hash): New global variable.
  3415. (cgraph_create_node): Break out of ....
  3416. (cgraph_node): ... this one.
  3417. (cgraph_redirect_edge_callee): New function.
  3418. (cgraph_remove_node): Aggressively elliminate dead nodes;
  3419. remove node out of clone list.
  3420. (dump_cgraph): Dump inlined_to field; dump uid numbers.
  3421. (cgraph_clone_edge): Return edge created.
  3422. (cgraph_clone_node): New.
  3423. (cgraph_function_possibly_inlined_p): Re-implement using hashtable.
  3424. * cgraph.h: Include hashtab.h
  3425. (struct cgraph_global_info): Kill inline_once, will be output and
  3426. cloned_times fields. Add inlined_to field.
  3427. (cgraph_node): Add next_clone.
  3428. (cgraph_inline_hash): Declare.
  3429. (cgraph_clone_edge): Update prototype.
  3430. (cgraph_clone_node, cgraph_redirect_callee): Declare.
  3431. * cgraphunit.c (cgraph_optimize_function): Kill.
  3432. (cgraph_assemble_function): Kill next_needed to avoid GGC corruption.
  3433. (cgraph_analyze_function): Do not intialize cloned_times and
  3434. will_be_output.
  3435. (cgraph_finalize_compilation_unit): Clear next_needed.
  3436. (cgraph_optimize_function): Kill.
  3437. (cgraph_expand_function): Do not use cgraph_optimize_function.
  3438. (cgraph_estimate_growth, cgraph_mark_inline,
  3439. cgraph_check_inline_limits, cgraph_recursive_inlining_p,
  3440. cgraph_preserve_function_body_p): Update for explicit clones.
  3441. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into,
  3442. cgraph_inlined_callees, struct cgraph_inline_context,
  3443. cgraph_create_inline_context, cgraph_free_inline_context,
  3444. cgraph_inline_context_set_caller, cgraph_inline_context_clear_caller,
  3445. cgraph_inline_context_set_callee, cgraph_inline_context_clear_callee,
  3446. update_callee_keys): Kill.
  3447. (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge): New.
  3448. (cgraph_decide_inlining_of_small_functions, (cgraph_decide_inlining,
  3449. cgraph_decide_inlining_incrementally): Simplify.
  3450. * tree-inline.c (typedef struct_inline_data): New field saving_p.
  3451. (copy_body_r): Update all clones.
  3452. (expand_call_inline): Remove inlined cgraph node.
  3453. (save_body): Inicialize id.node and id.saving_p.
  3454. * tree-optimize.c (tree_rest_of_compilation): Maintain clone up-to-date
  3455. in no-unit-at-a-time mode.
  3456. 2003-12-08 Steven Bosscher <stevenb@suse.de>
  3457. * tree-optimize.c (optimize_function_tree): Move verify_ssa calls
  3458. into conditionals.
  3459. 2003-12-08 Daniel Berlin <dberlin@dberlin.org>
  3460. * tree-alias-ander.c (andersen_same_points_to_set): Fix memory leak.
  3461. 2003-12-08 Jeff Law <law@redhat.com>
  3462. * tree-ssa-live.c (register_ssa_partition): Kill legacy code which
  3463. recursively called register_ssa_partition on PHI arguments when
  3464. SSA_VAR was defined by a PHI_NODE.
  3465. 2003-12-08 Jan Hubicka <jh@suse.cz>
  3466. * tree-dump.c (dump_files): Fix ordering of tail call pass.
  3467. * tree.h (tree_dump_index): Likewise.
  3468. 2003-12-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  3469. * Makefile.in (tree-cfg.o): Add gt-tree-cfg.h dependency.
  3470. (GTFILES): Add tree-cfg.c.
  3471. * tree-cfg.c: Include gt-tree-cfg.h.
  3472. (factored_computed_goto_label, factored_computed_goto):
  3473. Mark gc roots.
  3474. 2003-12-08 Steven Bosscher <stevenb@suse.de>
  3475. Jan Hubicka <jh@suse.de>
  3476. * gengtype-lex.l (IWOrD): Add HOST_WIDEST_INT
  3477. * Makefile.in (function.o, reg-stack.o): Add missing dependency on
  3478. basic-block.h.
  3479. (GTFILES): Add basic-block.h and hwint.h.
  3480. * basic-block.h (struct edge_def): Add GTY markers, make garbage
  3481. collectable. Make `insns' field GC safe depending on the setting
  3482. of cfg_hooks.
  3483. (struct basic_block_def): Add GTY markers, make garbage collectable.
  3484. (tree_bb_root, tree_phi_root): Kill extern decls.
  3485. (ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Change from macro to variable
  3486. (entry_exit_blocks): Kill.
  3487. * cfg.c: Include ggc.h
  3488. (bb_pool, edge_pool, entry_exit_blocks): Kill.
  3489. (ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Define.
  3490. (init_flow): Do not create ppols; allocate entry/exit block.
  3491. (free_edge, alloc_block, expunge_block, unchecked_make_edge): Use GGC.
  3492. (compact_blocks): Don't update tree_bb_root and tree_phi_root.
  3493. * cfgrtl.c (rtl_merge_blocks): Clear head pointer.
  3494. * regs.h: Protect against multiple inclusion.
  3495. * tree-cfg.c (obstack_tree_ann_obstack, first_block_tree_and_obj,
  3496. tree_bb_root): Kill.
  3497. (build_tree_cfg, create_bb, remove_bb, delete_tree_cfg): Don't
  3498. touch tree_bb_root and tree_phi_root.
  3499. (create_block_annotations): Do not initialize obstack.
  3500. (free_block_annotations): Do not free obstack.
  3501. (create_block_annotation): Use GGC.
  3502. * tree-dfa.c (tree_phi_root): Kill.
  3503. * tree-flow.h (bb_ann, bb_ann_d): Declare. Add `phi_nodes' field.
  3504. * tree-phinodes.c (create_phi_node, add_phi_arg, remove_phi_node,
  3505. remove_all_phi_nodes_for): Use `phi_nodes' field in the bb
  3506. annotation instead of tree_phi_root.
  3507. * tree-flow-inline.h (phi_nodes, set_phi_nodes): Likewise.
  3508. (add_dom_child, clear_dom_children): Use GGC.
  3509. * tree-ssa-pre.c (code_motion): Use `phi_nodes' field in the bb
  3510. annotation instead of tree_phi_root.
  3511. * varray.h (union varray_data): Make basic_block_def and edge_def
  3512. varrays garbage collectable.
  3513. 2003-12-07 Richard Henderson <rth@redhat.com>
  3514. * c-common.c (c_address_looks_like_offsetof): New.
  3515. * c-common.h (c_address_looks_like_offsetof): Declare.
  3516. * c-typeck.c (build_unary_op) <ADDR_EXPR>: Use it. Don't lower
  3517. address references not destined for offsetof.
  3518. (c_expand_return): Only look inside ARRAY_REF and COMPONENT_REF
  3519. when looking for returning address of local variable.
  3520. * expr.c (expand_expr_1): Don't dereference size of unbounded arrays.
  3521. * gimplify.c (gimplify_addr_expr): Only fold address of variable size
  3522. array elements.
  3523. * tree-simple.c (is_gimple_min_invariant): Also check
  3524. is_gimple_variable before disallowing offset address for type.
  3525. * tree-ssa-ccp.c (maybe_fold_offset_to_aggregate_ref): New.
  3526. (maybe_fold_offset_to_component_ref): Use it.
  3527. (maybe_fold_stmt_indirect, maybe_fold_stmt_plus): Likewise.
  3528. (maybe_fold_offset_to_array_ref): Likewise. Don't fail for division
  3529. remainder non-zero.
  3530. * varasm.c (initializer_constant_valid_p) <ADDR_EXPR>: Use
  3531. handled_component_p and look inside references.
  3532. <MINUS_EXPR>: Always look past widening casts.
  3533. 2003-12-07 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  3534. * tree-cfg.c (compute_dominance_frontiers): Don't assume that
  3535. the first block has index 0.
  3536. 2003-12-07 Jan Hubicka <jh@suse.cz>
  3537. * cgraph.c (create_edge): Rename to ...
  3538. (cgraph_create_edge): ... this one; accept call_expr as operand.
  3539. (cgraph_edge): New function
  3540. (cgraph_remove_edge): Use edge as argument
  3541. (cgraph_record_call, cgraph_remove_call): Kill.
  3542. (clone_cgraphedge): New function.
  3543. * cgraph.h (cgraph_edge): Add call_expr argument; add chain_next.
  3544. (cgraph_record_call, cgraph_remove_call): Kill prototype.
  3545. (cgraph_remove_call, cgraph_inline_p): Update prototype.
  3546. (cgraph_clone_edge): Declare.
  3547. * cgraphunit.c (cgraph_finalize_function): Update use of
  3548. cgraph_remove_edge
  3549. (record_call_1): Use cgraph_create_edge; record builtins too.
  3550. (cgraph_create_edges): Accept node instead of decl.
  3551. (cgraph_analyze_function): Update use cgraph_create_edges.
  3552. (cgraph_inline_p): Accept edge.
  3553. * tree-inline.c (inline_data): Replace decl and current_decl
  3554. by node and current_node.
  3555. (copy_body_r): Clone edges.
  3556. (expand_call_inline): Do not create inlined edges.
  3557. (optimize_inline_call): Set id->current_node, id->node.
  3558. * tree-optimize.c (tree_rest_of_compilation): Update cgraph edges after
  3559. compiling.
  3560. 2003-12-07 Diego Novillo <dnovillo@redhat.com>
  3561. * tree-ssa-loop.c (dump_file, dump_flags): Only declare with
  3562. checking enabled.
  3563. (tree_ssa_loop_opt): Mark arguments with ATTRIBUTE_UNUSED.
  3564. 2003-12-07 Richard Henderson <rth@redhat.com>
  3565. * function.h (struct function): Add last_label_uid.
  3566. * tree-cfg.c (set_bb_for_stmt): Use it.
  3567. (delete_tree_cfg): Clear label_to_block_map.
  3568. * gimple-low.c (lower_stmt_body): Export.
  3569. (lower_stmt): Allow data to be null.
  3570. * gimplify.c (declare_tmp_vars): Make static.
  3571. (push_gimplify_context): Export.
  3572. (pop_gimplify_context): Export. Put the temps somewhere.
  3573. (gimplify_body): Don't declare_tmp_vars here.
  3574. * tree-flow.h, tree-simple.h: Update for new decls.
  3575. * tree-mudflap.c (mf_build_string): New.
  3576. (mudflap_c_function_decls): Push and pop gimplify context, don't
  3577. gimplify here. Dump pass 1.
  3578. (mudflap_c_function_ops): Similarly.
  3579. (mf_decl_cache_locals): Gimplify eveything as we go along.
  3580. (mf_build_check_statement_for): Likewise.
  3581. (mf_mostly_copy_tree_r): Remove.
  3582. (mf_varname_tree): Use mf_build_string.
  3583. (mf_file_function_line_tree): Rewrite.
  3584. (mf_offset_expr_of_array_ref): Remove.
  3585. (mx_xfn_indirect_ref): Remove.
  3586. (mf_xform_derefs_1): New.
  3587. (mf_xform_derefs): Rewrite to expect gimple.
  3588. (mx_register_decls): Use build_function_call_expr.
  3589. (mudflap_enqueue_constant): Use mf_build_string.
  3590. * tree-optimize.c (tree_rest_of_compilation): Reorder mudflap bits.
  3591. * tree-dump.c (dump_files): Split mudflap to parts 1 and 2.
  3592. * tree.h (enum tree_dump_index): Likewise.
  3593. 2003-12-06 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  3594. * tree-ssa-loop.c: New.
  3595. * Makefile.in (tree-ssa-loop.o): New.
  3596. * common.opt (ftree-loop-optimize): Add.
  3597. * flags.h (flag_tree_loop): Declare.
  3598. * opts.c (decode_options): Enable flag_tree_loop at -O1.
  3599. (common_handle_option): Handle OPT_ftree_loop_optimize.
  3600. * timevar.def (TV_TREE_LOOP): New.
  3601. * toplev.c (flag_tree_loop): New.
  3602. (f_options): Add -ftree-loop-optimize.
  3603. * tree-cfg.c (build_tree_cfg): Remove disabled loop optimizer
  3604. initialization.
  3605. (tree_make_forwarder_block): Update phi nodes.
  3606. (tree_loop_optimizer_init): Don't call force_single_succ_latches.
  3607. (tree_try_redirect_by_replacing_jump): Comment fix.
  3608. * tree-dump.c (dump_files): Add .loop dump.
  3609. * tree-flow.h (tree_ssa_loop_opt, set_phi_nodes): Declare.
  3610. * tree-optimize.c (optimize_function_tree): Call tree_ssa_loop_opt.
  3611. * tree.h (enum tree_dump_index): Add TDI_loop.
  3612. * tree-flow-inline.h (set_phi_nodes): New.
  3613. * doc/invoke.texi (-fdump-tree-loop, -ftree-loop-optimize): Document.
  3614. 2003-12-05 Jeff Law <law@redhat.com>
  3615. * tree-dfa.c (mark_new_vars_to_rename): Change VARS_TO_RENAME to be
  3616. a "bitmap" instead of an "sbitmap". Callers updated.
  3617. * tree-must-alias.c (promote_var): Likewise.
  3618. (tree_compute_must_alias): Likewise.
  3619. * tree-phinodes.c (remove_all_phi_nodes_for): Likewise.
  3620. * tree-ssa-dom.c (tree_ssa_dominator_thread_jumps): Likewise.
  3621. (tree_ssa_dominator_optimize): Likewise.
  3622. (tree_ssa_dominator_optimize_1): Likewise.
  3623. * tree-ssa-pre.c (pre_expression): Likewise.
  3624. (tree_perform_ssapre): Likewise.
  3625. * tree-ssa.c (rewrite_into_ssa): Likewise.
  3626. (insert_phi_nodes): If VARS_TO_RENAME is zero, then examine
  3627. each node to determine if we need to insert a PHI.
  3628. (prepare_operand_for_rename): If VARS_TO_RENAME is zero, then
  3629. assume the operand needs renaming.
  3630. * tree-ssa-ccp.c (substitute_and_fold): Change VARS_TO_RENAME to
  3631. be a "bitmap" instead of an "sbitmap". Callers updated.
  3632. (tree_ssa_ccp): Likewise. Also make sure timevar_pop encloses
  3633. entire function.
  3634. (scalarize_modify_expr): Likewise.
  3635. * tree-sra.c (create_scalar_copies): Change VARS_TO_RENAME to
  3636. be a "bitmap" instead of an "sbitmap". Callers updated.
  3637. (tree_sra): Likewise.
  3638. * tree-optimize.c (optimize_function_tree): Make VARS_TO_RENAME
  3639. be a "bitmap" instead of an "sbitmap".
  3640. * tree-flow.h: Update various prototypes.
  3641. 2003-12-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  3642. * tree-cfg.c (remove_useless_stmts_goto, remove_useless_stmts): Move
  3643. handling of factored_computed_goto ...
  3644. (disband_implicit_edges): ... here.
  3645. 2003-12-05 Jan Hubicka <jh@suse.cz>
  3646. * tree-eh.c (tree_could_trap_p): Fix warning.
  3647. * expr.c (expand_expr): Fix warning on uninitialized last.
  3648. 2003-12-04 Jeff Law <law@redhat.com>
  3649. * tree-ssa.c (rewrite_trees): Do not unconditionally overwrite
  3650. variables set by statements. Let replace_variable do any
  3651. required rewriting.
  3652. 2003-12-04 Richard Henderson <rth@redhat.com>
  3653. * c-parse.in (primary): Use annotate_with_locus instead of
  3654. STMT_LINENO for STMT_EXPR.
  3655. * c-simplify.c (gimplify_stmt_expr): Likewise.
  3656. 2003-12-04 Jan Hubicka <jh@suse.cz>
  3657. * tree-dump.c (dump_files): Reorder tailcall and mustalias
  3658. * tree.h (tree_dump_index): Likewise.
  3659. * tree-optimize.c (optimize_function_tree): Do tail call after mustalias.
  3660. 2003-12-04 Diego Novillo <dnovillo@redhat.com>
  3661. * tree-dfa.c (opf_none, opf_is_def, opf_no_vops): Change to #define.
  3662. 2003-12-04 Canqun Yang <canqun@nudt.edu.cn>
  3663. * stor-layout.c (update_alignment_for_field): Export.
  3664. * tree.h (update_alignment_for_field): Declare.
  3665. 2003-12-03 Andrew Haley <aph@redhat.com>
  3666. * tree-eh.c (tree_could_trap_p): Add division instructions.
  3667. * expr.c (expand_expr): Check the EH region of an expression and
  3668. mark all the insns that result from its expansion with the
  3669. appropriate REG_EH_REGION.
  3670. 2003-12-03 Jan Hubicka <jh@suse.cz>
  3671. * tree-cfg.c (verify_addr_expr, verify_stmt, tree_node_shared_p,
  3672. verify_stmts): New functions.
  3673. (verify_flow_info): Remove PHI checking code.
  3674. * tree-flow.h (verify_stmt, verify_stmts): Declare.
  3675. * tree-inline.h (walk_tree, walk_tree_without_duplicates): Move
  3676. prototypes ...
  3677. * tree.h (walk_tree, walk_tree_without_duplicates): ... here.
  3678. 2003-12-03 Jan Hubicka <jh@suse.cz>
  3679. Diego Novillo <dnovillo@redhat.com>
  3680. * tree-ssa.c (verify_def, verify_use, verify_phi_args): New static
  3681. functions.
  3682. (verify_ssa): New global function.
  3683. * tree-flow.h (verify_ssa): Declare.
  3684. * tree-optimize.c (optimize_function_tree): Call it.
  3685. 2003-12-03 Diego Novillo <dnovillo@redhat.com>
  3686. * timevar.def (TV_TREE_SSA_VERIFY): New timer.
  3687. * tree-sra.c (create_scalar_copies): Always mark the previous
  3688. variables on the LHS for renaming.
  3689. Do not emit unnecessary assignments from VA_ARG_EXPRs.
  3690. (scalarize_modify_expr): Similarly, when scalarizing the LHS of a
  3691. COMPONENT_REF assignment.
  3692. * tree-must-alias.c (tree_compute_must_alias): Do not promote
  3693. variables with hidden uses.
  3694. * tree-ssa-ccp.c (set_rhs): When replacing the whole statement, reset
  3695. SSA_NAME_DEF_STMT for all the SSA_NAMEs in vdef and def
  3696. operands.
  3697. 2003-12-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  3698. Diego Novillo <dnovillo@redhat.com>
  3699. * tree-dfa.c (opf_no_vops): New.
  3700. (add_stmt_operand): Don't create virtual operands when opf_no_vops
  3701. is passed in flags.
  3702. (get_expr_operands): Set opf_no_vops flag before diving into the
  3703. operand of an ADDR_EXPR node.
  3704. 2003-12-03 Richard Henderson <rth@redhat.com>
  3705. * tree-simple.c (is_gimple_min_invariant): Disallow offset of
  3706. address of a scalar.
  3707. * c-parse.in (primary): Set STMT_LINENO on STMT_EXPR.
  3708. * c-simplify.c (gimplify_stmt_expr): Be prepared for last_stmt
  3709. to be null.
  3710. 2003-12-03 Daniel Berlin <dberlin@dberlin.org>
  3711. Fix PR 13177
  3712. * tree-ssa-pre.c (code_motion): Do phi nodes last, and rearrange
  3713. how we decide what temporary to choose so that we get it right.
  3714. 2003-12-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  3715. * tree-dfa.c (get_expr_operands): Don't record VUSEs for invariant
  3716. adresses.
  3717. 2003-12-03 Brian Booth <bbooth@redhat.com>
  3718. * tree-pretty-print.c (dump_phi_nodes): Removed superfluous ampersand.
  3719. 2003-12-03 Jeff Law <law@redhat.com>
  3720. * ggc-page.c: Resync with mainline sources. Remove tree-ssa
  3721. specific hack which disabled special GC pagesizes for 2 operand
  3722. tree expressions.
  3723. * tree-ssa.c (mark_def_sites): Call prepare_operand_for_rename
  3724. on the VDEF_RESULT as well, providing a dummy uid argument.
  3725. * tree-phinodes.c: Include rtl.h for ceil_log2.
  3726. (ideal_phi_node_len): New function.
  3727. (resize_phi_node): Make static.
  3728. (make_phi_node): Use ideal_phi_node_len.
  3729. (add_phi_arg): Likewise.
  3730. * tree.h (resize_phi_node): Remove prototype.
  3731. * Makefile.in (tree-phinodes.o): Depend on $(RTL_H).
  3732. 2003-12-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  3733. * tree-cfg.c: (make_edges): Eliminate fallthru to exit.
  3734. (make_ctrl_stmt_edges): Nonlocal goto handling moved to
  3735. make_goto_expr_edges.
  3736. (make_goto_expr_edges): Remove simple gotos.
  3737. (cfg_remove_useless_stmts_bb): Goto removal cancelled.
  3738. (cleanup_cond_expr_graph, cleanup_switch_expr_graph):
  3739. Replaced by ...
  3740. (cleanup_control_expr_graph): New.
  3741. (cleanup_control_flow): Use it.
  3742. (disband_implicit_edges): New.
  3743. (tree_find_edge_insert_loc): Never insert before a control statement.
  3744. (tree_split_edge, thread_jumps, tree_try_redirect_by_replacing_jump,
  3745. tree_redirect_edge_and_branch): Work over no-gotos form.
  3746. (tree_verify_flow_info): Check no-gotos form invariants.
  3747. * tree-pretty-print.c (pp_cfg_jump, dump_implicit_edges): New.
  3748. (dump_generic_bb_buff): Call dump_implicit_edges.
  3749. * tree-flow.h (cleanup_cond_expr_graph, cleanup_switch_expr_graph):
  3750. Declaration removed.
  3751. (cleanup_control_expr_graph, delete_tree_ssa, disband_implicit_edges):
  3752. Declare.
  3753. * tree-optimize.c (tree_ssa_finish): New.
  3754. (optimize_function_tree): Call it.
  3755. * tree-ssa-dom.c (thread_jumps_walk_stmts, optimize_stmt): Use
  3756. cleanup_control_expr_graph.
  3757. * tree-ssa.c (delete_tree_ssa): Export, work even if there are no
  3758. referenced_vars.
  3759. (rewrite_out_of_ssa): Don't call it.
  3760. 2003-12-03 Jan Hubicka <jh@suse.cz>
  3761. * tree-ssa.dom.c (tree_ssa_domionator_thread_jumps): Mark back edges.
  3762. (thread_across_edge): Do not thread across loop headers.
  3763. * Makefile.in (tree-optimize.o): Depend on cgraph.h
  3764. * cgraph.h (cgraph_preserve_function_body_p): Declare.
  3765. * cgraphunit.c (cgraph_preserve_function_body_p): New function.
  3766. * tree-optimize.c: Include cgraph.h
  3767. (clear_decl_rtl): Kill.
  3768. (tree_rest_of_compilation): Use cgraph_preserve_function_body_p;
  3769. do not clear DECL_RTL; do final ggc in the pushed context for nested
  3770. functions;
  3771. 2003-12-02 Jeff Law <law@redhat.com>
  3772. * tree-ssa-dom.c (optimize_stmt): Accept and pass down dominator
  3773. walker structure instead of individual varrays. Callers updated.
  3774. (eliminate_redundant_computations): Likewise.
  3775. (simplify_rhs_and_lookup_avail_expr): Likewise. Cache and update
  3776. a dummy COND_EXPR when querying the hash tables when transforming
  3777. DIV/MOD into RSHIFT/BIT_AND or ABS_EXPR into NEG_EXPR.
  3778. (dom_opt_walk_stmts): Don't reload the block data pointer each
  3779. iteration of the loop. Load it once outside the loop.
  3780. * tree-dfa.c (cleanup_operand_arrays): Avoid creating a new
  3781. varray for the vuse operands.
  3782. * tree-ssa-dom.c (extract_range_from_cond): Use int_const_binop to
  3783. avoid creating useless tree nodes.
  3784. * tree-phinodes.c (add_phi_arg): If we receive a new node from
  3785. resize_phi_node, then release the old node and update the PHI
  3786. chain.
  3787. 2003-12-02 Brian Booth <bbooth@redhat.com>
  3788. * tree-pretty-print.c (dump_phi_nodes): Added code to always show phi
  3789. nodes of regular gimple scalars.
  3790. (dump_generic_bb_buff): Removed condition upon which to show phi nodes.
  3791. 2003-12-02 Jan Hubicka <jh@suse.cz>
  3792. * tree-optimize.c (optimize_function_tree): Invoke ggc_collect in
  3793. between optimization passes.
  3794. 2003-12-02 Daniel Berlin <dberlin@dberlin.org>
  3795. * tree-sra.c (can_be_scalarized_p): Print details about why something
  3796. could not be scalarized to the dump file.
  3797. 2003-12-01 Jeff Law <law@redhat.com>
  3798. * Makefile.in (OBJS-common): Add tree-phinodes.o.
  3799. (tree-phinodes.o): Add dependencies.
  3800. (GTFILES): Add tree-phinodes.c.
  3801. * tree-phinodes.c: New file.
  3802. * tree-dfa.c (create_phi_node): Moved to tree-phinodes.o.
  3803. (add_phi_arg, remove_phi_arg, remove_phi_arg_num): Similarly.
  3804. (remove_phi_node, remove_all_phi_nodes_for): Similarly.
  3805. * tree-ssa.c (init_tree_ssa): Initialize PHI node management.
  3806. (delete_tree_ssa): Finalize PHI node management.
  3807. * tree.c (dump_tree_statistics): Dump PHI node stats.
  3808. (make_phi_node, resize_phi_node): Moved to tree-phinodes.o.
  3809. * tree.h (init_phinodes): Prototype.
  3810. (fini_phinodes, release_phi_node): Likewise.
  3811. (phinodes_print_statistics): Likewise.
  3812. 2003-12-01 Richard Henderson <rth@redhat.com>
  3813. * tree-dfa.c (get_expr_operands): Don't handle PLUS_EXPR inside
  3814. INDIRECT_REF.
  3815. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Use int_const_binop.
  3816. (maybe_fold_offset_to_component_ref): Likewise.
  3817. (maybe_fold_stmt_indirect): Likewise.
  3818. (maybe_fold_stmt_plus): Expand ARRAY_REF when seen with addend.
  3819. * fold-const.c (int_const_binop): Export.
  3820. * tree.h (int_const_binop): Declare.
  3821. 2003-12-01 Jan Hubicka <jh@suse.cz>
  3822. * basic-block.h (tree_phi_root): New variable.
  3823. * cfg.c: Include tree-flow.h.
  3824. (compact_blocks): Compact tree_phi_root
  3825. * tree-cfg.c (build_tree_cfg): Initialize tree_phi_root.
  3826. (create_bb, remove_bb, delete_tree_cfg): Update tree_phi_root.
  3827. * tree-dfa.c (tree_phi_root): Declare.
  3828. (create_phi_node, add_phi_arg, remove_phi_node,
  3829. remove_all_phi_nodes_for): Always use accessor functions for
  3830. getting, varray for setting phis.
  3831. * tree-ssa-pre.c (code_motion): Likewsie.
  3832. * tree-flow-inline.h (phi_nodes): Use varray.
  3833. * tree-flow.h (bb_ann_d): Remove phi_nodes.
  3834. * tree-ssanames.c (free_ssanames): Do not use deleteable GTY flag.
  3835. 2003-11-30 Jan Hubicka <jh@suse.cz>
  3836. * tree-optimize.c (tree_rest_of_compilation): Move ggc_collect call to
  3837. the end of function; keep clearing of DECL_SAVED_TREE to the cgraph
  3838. code.
  3839. 2003-11-30 Jan Hubicka <jh@suse.cz>
  3840. * cgraphunit.c (cgraph_inline_context): New structure.
  3841. (cgrpah_mark_inline, cgraph_check_inline_limits): Use context
  3842. instead of passing all arguments by hand.
  3843. (cgraph_create_inline_context, cgraph_free_inline_context,
  3844. cgraph_inline_context_set_caller, cgraph_inline_context_clear_caller,
  3845. cgraph_inline_context_set_callee, cgrpah_inline_context_clear_callee,
  3846. cgraph_recursive_inlining_p): New static function.
  3847. (cgraph_decide_inline*): Reorganize to use context.
  3848. 2003-11-30 Paul Brook <paul@nowt.org>
  3849. * Makefile.in (GTFILES): Remove stray '\'.
  3850. 2003-11-30 Daniel Berlin <dberlin@dberlin.org>
  3851. * c-config-lang.in: Move tree-alias-* from here
  3852. * Makefile.in (GTFILES): To here.
  3853. * tree-alias-ander.c: Include bitmap.h
  3854. (andersen_function_call): Updated to take address of variables
  3855. in an ADDR_EXPR in a CALL_EXPR.
  3856. * tree-alias-common.h (struct tree_alias_ops): Update arguments to
  3857. function_call.
  3858. * tree-alias-type.h (struct alias_typevar_common): Add varnum.
  3859. * tree-alias-common.c: Include bitmap.h, and function.h.
  3860. s/global_var/pta_global_var/g.
  3861. (addrargs): New static variable.
  3862. (pta_global_var): Ditto.
  3863. (find_func_decls): Remove.
  3864. (find_func_aliases): Take one argument, update all callers.
  3865. Handle (cast) [addr-expr] [var].
  3866. Handle COMPONENT_REF of an INDIRECT_REF.
  3867. Pass info about ADDR_EXPR arguments to function_call function.
  3868. (deal_with_call_aliasing): New function.
  3869. (call_may_return): New function.
  3870. (get_alias_var_decl): Call find_func_aliases on the DECL_INITIAL
  3871. of a global var.
  3872. Use ALIAS_TVAR_VARNUM, instead of VARRAY_ACTIVE_SIZE (alias_vars) - 1.
  3873. (get_alias_var): Handle REALPART_EXPR and IMAGPART_EXPR.
  3874. Return NULL in default case.
  3875. (intra_function_call): Remove wrong code.
  3876. (create_fun_alias_var): Use simple_assign, not addr_assign.
  3877. Set up ALIAS_TVAR_VARNUM when creating an alias var.
  3878. (create_fun_alis_var_ptf): Ditto on ALIAS_TVAR_VARNUM.
  3879. (create_alias_var): Ditto.
  3880. (create_alias_vars): Build pta_global_var here.
  3881. Walk unexpanded_var_list.
  3882. Walk the statements in basic blocks.
  3883. (delete_alias_vars): Correct ip_partial case.
  3884. Free addrargs.
  3885. (init_alias_vars): Create addrargs.
  3886. 2003-11-29 Jan Hubicka <jh@suse.cz>
  3887. * Makefile.in (tree-ssanames.o): Depend on gt-tree-ssanames.h.
  3888. (tree-eh.o): Depend on gt-tree-eh.h.
  3889. (gr-tree-ssanames.h, gt-tree-eh.h): New targets.
  3890. (GTFILES): Add tree-ssanames.c, tree-eh.c
  3891. * tree-eh.c: Include ggc.h and gt-tree-eh.h
  3892. (lower_eh_constructs): Allecate throw_stmt_table in ggc.
  3893. * tree-ssanames.c: Include ggc.h and gt-tree-ssanames.h
  3894. * function.h (struct function): Add saved_tree/saved_args.
  3895. * toplev.c (rest_of_compilation): Move code to clear cfun and
  3896. DECL_SAVED_INSNS and call to ggc_collect to ...
  3897. * tree-optimize.c (tree_rest_of_compilation): ... this function. Use
  3898. cfun to save/restore function body.
  3899. 2003-11-28 Richard Henderson <rth@redhat.com>
  3900. * gimplify.c (create_tmp_var_raw): Split out from create_tmp_var.
  3901. (create_tmp_var): Use it.
  3902. (create_tmp_alias_var): Remove.
  3903. * tree-alias-common.c, tree-dfa.c: Use create_tmp_var_raw instead.
  3904. * tree-simple.h: Update decls.
  3905. 2003-11-28 Richard Henderson <rth@redhat.com>
  3906. * gimple-low.c (lower_function_body): Call lower_bind_expr
  3907. to handle the outermost BIND_EXPR.
  3908. 2003-11-28 Jan Hubicka <jh@suse.cz>
  3909. * tree-ssa.c (remove_annotations_r): Kill.
  3910. (delete_tree_ssa): Remove annotations using statement walk;
  3911. kill argument fndecl.
  3912. (rewrite_out_of_ssa): Update call.
  3913. 2003-11-27 Andrew MacLeod <amacleod@redhat.com>
  3914. * tree-ssa-live.c (register_ssa_partition): Abort if a virtual SSA
  3915. version is registered.
  3916. (create_ssa_var_map): Always process PHI nodes.
  3917. * tree-ssa.c (Eliminate_virtual_phis): Rename from
  3918. eliminate_extraneous_phis, and look specifically for virtuals.
  3919. (rewrite_out_of_ssa): Eliminate virtual PHI nodes before building
  3920. partitions.
  3921. 2003-11-27 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  3922. * tree-ssa-ccp.c (get_strlen): Mark the visited variables.
  3923. (ccp_fold_builtin): Changed due to changed calling convention of
  3924. get_strlen.
  3925. 2003-11-26 Diego Novillo <dnovillo@redhat.com>
  3926. Revert
  3927. 2003-11-25 Jeff law <law@redhat.com>
  3928. * Makefile.in (OBJS-common): Add tree-phinodes.o.
  3929. (tree-phinodes.o): Add dependencies.
  3930. * tree-phinodes.c: New file.
  3931. * tree-dfa.c (create_phi_node): Moved to tree-phinodes.o.
  3932. (add_phi_arg, remove_phi_arg, remove_phi_arg_num): Similarly.
  3933. (remove_phi_node, remove_all_phi_nodes_for): Similarly.
  3934. * tree-ssa.c (init_tree_ssa): Initialize PHI node management.
  3935. (delete_tree_ssa): Finalize PHI node management.
  3936. * tree.c (dump_tree_statistics): Dump PHI node stats.
  3937. (make_phi_node, resize_phi_node): Moved to tree-phinodes.o.
  3938. * tree.h (init_phinodes): Prototype.
  3939. (fini_phinodes, release_phi_node): Likewise.
  3940. (phinodes_print_statistics): Likewise.
  3941. 2003-11-25 Jan Hubicka <jh@suse.cz>
  3942. * tree-mustalias.c (promote_var): Do not clear
  3943. may_point_to_global_mem.
  3944. 2003-11-25 Jeff law <law@redhat.com>
  3945. * domwalk.c (walk_dominator_tree): Indicate to the block local
  3946. data initializer if the block local data is new or recycled.
  3947. * domwalk.h (struct dom_walk_data): Corresponding changes.
  3948. * tree-ssa-dom.c (dom_opt_initialize_block_local_data): Accept and use
  3949. "recycled" argument. For recycled structures, only clear varrays
  3950. that have been initialized. For new blocks, do not initialize
  3951. varrays here.
  3952. (dom_opt_finalize_block): When threading across edges, if the
  3953. true/false varrays have not been initialized, then the limit is zero.
  3954. Only clear block local varrays that have been initialized.
  3955. (record_equivalences_from_incoming_edge): If necessary, initialize
  3956. block local const_and_copies.
  3957. (dom_opt_walk_stmts): If necessary, initialize block local
  3958. stmts_to_rescan.
  3959. (record_var_is_nonzero): If necessary, initialize block local
  3960. nonzero_vars.
  3961. (record_cond_is_true): If necessary, initialize block local
  3962. true_exprs.
  3963. (record_cond_is_false): If necessary, initialize block local
  3964. false_exprs.
  3965. (lookup_avail_expr): If necessary, initialize block local
  3966. avail_exprs.
  3967. (record_range): If necessary, initialize block local vrp_varaibles.
  3968. * tree-ssa.c
  3969. * tree-ssa.c (rewrite_initialize_block_local_data): Accept and use
  3970. "recycled" argument. For recycled structures, only clear varrays
  3971. that have been initialized. For new blocks, do not initialize
  3972. varrays here.
  3973. (rewrite_finalize_block): Only clear block local varrays that have
  3974. been initialized.
  3975. (register_new_def): If necessary, initialize block local defs.
  3976. * tree-ssa-dom.c (get_eq_expr_value): Return a struct rather than
  3977. a tree node.
  3978. (record_equivalences_from_incoming_edge): Corresponding changes.
  3979. (find_equivalent_equality_comparison): Use tree_int_cst_XXX rather
  3980. then building and folding nodes.
  3981. (simplify_cond_and_lookup_avail_expr): Likewise.
  3982. * Makefile.in (OBJS-common): Add tree-phinodes.o.
  3983. (tree-phinodes.o): Add dependencies.
  3984. * tree-phinodes.c: New file.
  3985. * tree-dfa.c (create_phi_node): Moved to tree-phinodes.o.
  3986. (add_phi_arg, remove_phi_arg, remove_phi_arg_num): Similarly.
  3987. (remove_phi_node, remove_all_phi_nodes_for): Similarly.
  3988. * tree-ssa.c (init_tree_ssa): Initialize PHI node management.
  3989. (delete_tree_ssa): Finalize PHI node management.
  3990. * tree.c (dump_tree_statistics): Dump PHI node stats.
  3991. (make_phi_node, resize_phi_node): Moved to tree-phinodes.o.
  3992. * tree.h (init_phinodes): Prototype.
  3993. (fini_phinodes, release_phi_node): Likewise.
  3994. (phinodes_print_statistics): Likewise.
  3995. 2003-11-25 Jan Hubicka <jh@suse.cz>
  3996. * tree-inline.c (save_body): New body
  3997. * tree-inline.h (save_body): Declare.
  3998. * tree-optimize.c (tree_rest_of_compilation): Save function tree
  3999. properly.
  4000. 2003-11-24 Richard Henderson <rth@redhat.com>
  4001. * gimplify.c (canonicalize_addr_expr): New.
  4002. (gimplify_conversion): Use it. Canonicalize after nop cast removal.
  4003. * tree-simple.c (is_gimple_min_invariant): Remove STRING_CST cast
  4004. special case.
  4005. 2003-11-24 Jeff Law <law@redhat.com>
  4006. * flow.c (count_or_remove_death_notes_bb): New. Extracted from
  4007. count_or_remove_death_notes.
  4008. (count_or_remove_death_notes): Use EXECUTE_IF_SET_IN_SBITMAP.
  4009. 2003-11-24 Richard Henderson <rth@redhat.com>
  4010. PR 13174, PR 13143
  4011. * gimplify.c (cpt_same_type): Allow different ARRAY_TYPEs with
  4012. the same base type.
  4013. 2003-11-24 Daniel Berlin <dberlin@dberlin.org>
  4014. Fix PR/13163
  4015. * tree-ssa-pre.c (append_eref_to_block): Delete.
  4016. (insert_euse_in_preorder_dt_order_1): Ditto.
  4017. (insert_one_operand): Take an extra argument, because
  4018. avdefs may need to be changed.
  4019. (clear_all_eref_arrays): Use FOR_ALL_BB.
  4020. (insert_occ_in_preorder_dt_order): Stop appending to bb eref arrays.
  4021. Use FOR_ALL_BB.
  4022. (insert_euse_in_preorder_dt_order): Rewrite to just build a new varray
  4023. with only the EPHI's and EUSE's, and then sort it.
  4024. (pre_expression): Don't use bb based erefs array when printing
  4025. expressions.
  4026. (split_critical_edges): Just use FOR_ALL_BB.
  4027. (tree_perform_ssapre): Pre-split entry block successor edge if the
  4028. successor block has multiple preds.
  4029. * tree-flow.h (struct bb_ann_d): Remove erefs varray.
  4030. 2003-11-24 Daniel Berlin <dberlin@dberlin.org>
  4031. * tree-cfg.c (cleanup_tree_cfg): FOR_EACH_BB -> FOR_ALL_BB when
  4032. clearing dom children, because the entry block has dom_children
  4033. too.
  4034. * tree-ssa.c (build_dominator_tree): Ditto.
  4035. 2003-11-24 Diego Novillo <dnovillo@redhat.com>
  4036. * tree-cfg.c (compute_dominance_frontiers_1,
  4037. compute_dominance_frontiers): Move from ssa.c.
  4038. * tree-flow.h (compute_dominance_frontiers): Declare.
  4039. * Makefile.in (tree-ssa.o, tree-ssa-live.o, tree-ssa-pre.o,
  4040. tree-optimize.o): Don't depend on ssa.h.
  4041. * tree-ssa.c: Don't include ssa.h.
  4042. * tree-ssa-live.c: Likewise.
  4043. * tree-ssa-pre.c: Likewise.
  4044. * tree-optimize.c: Likewise.
  4045. 2003-11-24 Jan Hubicka <jh@suse.cz>
  4046. * fold-const.c (fold): Do not return early when
  4047. optimizing COMPONENT_REF and constant.
  4048. 2003-11-24 Richard Henderson <rth@redhat.com>
  4049. * objc/objc-act.c (build_protocol_expr): Use convert instead of
  4050. smashing TREE_TYPE.
  4051. 2003-11-23 Andrew MacLeod <amacleod@redhat.com>
  4052. * tree-ssa-live.h (SSANORM_PERFORM_TER, SSANORM_COMBINE_TEMPS,
  4053. SSANORM_REMOVE_ALL_PHIS): New flag macros.
  4054. * tree-ssa.c (replace_variable): Return true if var was rewritten.
  4055. (eliminate_extraneous_phis): Dump var map to file if checking triggers
  4056. an abort.
  4057. (rewrite_trees): Set modified_stmt if stmt was changed.
  4058. (remove_ssa_form): Move more of rewrite_out_of_ssa to make it serve
  4059. all the same functions based on new flags in tree-ssa-live.h.
  4060. (rewrite_out_of_ssa): Call remove_ssa_form.
  4061. 2003-11-23 Jan Hubicka <jh@suse.cz>
  4062. * tree-cfg.c (tree_verify_flow_info): Check that ENTRY/EXIT block
  4063. has no instructions associated with it.
  4064. 2003-11-22 Jeff Law <law@redhat.com>
  4065. * tree-ssa-names.c (release_ssa_name): Use SSA_NAME_IN_FREE_LIST
  4066. instead of checking SSA_NAME_DEF_STMT being null.
  4067. * tree.h (SSA_NAME_DEF_STMT): Use chain field rather than the
  4068. def_stmt field.
  4069. (SSA_NAME_OCCURS_IN_ABNORMAL_PHI): Use existing flag from tree_common.
  4070. (SSA_NAME_IN_FREE_LIST): Define.
  4071. (struct tree_ssa_name): Kill DEF_STMT and OCCURS_IN_ABNORMAL_PHI fields.
  4072. 2003-11-22 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  4073. * tree-pretty-print.c (dump_generic_node): Remove superfluous ';'.
  4074. 2003-11-22 Diego Novillo <dnovillo@redhat.com>
  4075. * Makefile.in (simple-break-elim.o): Remove.
  4076. (simple-goto-elim.o): Remove.
  4077. (tree-dchain.o): Remove.
  4078. * simple-break-elim.c: Remove.
  4079. * simple-goto-elim.c: Remove.
  4080. * tree-dchain.c: Remove.
  4081. * tree-dchain.h: Remove.
  4082. 2003-11-22 Daniel Berlin <dberlin@dberlin.org>
  4083. * tree-ssa-pre.c (build_dfs_id_array_1): > should be >=
  4084. (build_dfn_array): Ditto.
  4085. 2003-11-21 Diego Novillo <dnovillo@redhat.com>
  4086. * Makefile.in (tree-dfa.o): Add dependency on $(TREE_DUMP_H)
  4087. * tree-dfa.c: Include tree-dump.h
  4088. (compute_alias_sets): Call dump_function_to_file.
  4089. (may_access_global_mem_p): Check if the base address of _REF nodes
  4090. may point to global memory.
  4091. * cfgcleanup.c (try_crossjump_to_edge): Initialize newpos1 and
  4092. newpos2.
  4093. 2003-11-21 Jeff Law <law@redhat.com>
  4094. Revert:
  4095. 2003-11-21 Jan Hubicka <jh@suse.cz>
  4096. * tree-dfa.c (get_expr_operands): Fix handling of CALL_EXPR.
  4097. * tree-must-alias.c (tree_compute_must_alias): promote pointers.
  4098. (find_addressable_vars): Deal with complex constant
  4099. expressions; do not clear may_point_to_global_mem.
  4100. 2003-11-21 Jeff Law <law@redhat.com>
  4101. * Makefile.in (domwalk.o): Depend on $(GGC_H).
  4102. * domwalk.c: Include ggc.h.
  4103. (walk_dominator_tree): Manage allocation/deallocation and
  4104. pushing/popping of the toplevel block data pointer here.
  4105. Use callback to initialize the block local data.
  4106. (init_walk_dominator_tree): New function.
  4107. (fini_walk_dominator_tree): Likewise.
  4108. * domwalk.h (struct dom_walk_data): Add callback to initialize
  4109. block local data. Add field for sizeof block local data.
  4110. Add "private" field free_block_data.
  4111. (init_dominator_tree, fini_dominator_tree): Prototype.
  4112. * tree-ssa-dom.c (dom_opt_initialize_local_data): New function.
  4113. (tree_ssa_dominator_optimize_1): Initialize new fields in the
  4114. dominator walker structure. Initialize and finalize the dominator
  4115. walker. Slightly reorder code to make it more readable..
  4116. (dom_opt_initialize_block): No longer deal with allocation and
  4117. initialization of block local data.
  4118. (dom_opt_finalize_block): Similarly for deallocation of block
  4119. local data.
  4120. * tree-ssa.c (rewrite_block_data): New structure.
  4121. (rewrite_initialize_block_local_data): New function.
  4122. (rewrite_initialize_block): No longer deal with allocation and
  4123. initialization of block local data.
  4124. (rewrite_into_ssa): Initialize new fields in the dominator walker
  4125. structure. Initialize and finalize the dominator walker.
  4126. (rewrite_initialize_block): No longer deal with allocation and
  4127. initialization of block local data.
  4128. (rewrite_optimize_stmts): Deal with changes in the dominator
  4129. walker structure.
  4130. (rewrite_finalize_block): No longer with deallocation of block
  4131. local data.
  4132. * tree-dfa.c (add_vdef, cleanup_voperand_arrays): Use NUM_VDEFS.
  4133. (mark_new_vars_to_rename, collect_dfa_status_r): Likewise.
  4134. * tree-pretty-print.c (dump_vops): Likewise.
  4135. * tree-sra.c (create_scalar_copies): Likewise.
  4136. * tree-ssa-dce.c (stmt_useful_p, process_worklist): Likewise.
  4137. * tree-ssa-live.c (create_ssa_var_map): Likewise.
  4138. (calculate_live_on_entry): Likewise.
  4139. * tree-ssa-pre.c (process_left_occs_and_kills): Likewise.
  4140. * tree-ssa.c (mark_def_sites, rewrite_stmt): Likewise.
  4141. * tree.h (NUM_VDEFS): Define.
  4142. * tree-ssa-ccp.c (visit_stmt): Use NUM_VDEFS. Fix thinko in last
  4143. change.
  4144. (initialize): Use NUM_VDEFS.
  4145. * tree-dfa.c (add_vdef): Revamp to handle new method for
  4146. recording vdefs.
  4147. (cleanup_operand_arrays): Similarly.
  4148. * tree-sra.c (create_scalar_copies): Similarly.
  4149. * tree-ssa-ccp.c (visit_stmt, initialize): Similarly.
  4150. * tree-ssa-dce.c (stmt_useful_p, process_worklist): Similarly.
  4151. * tree-ssa-dom.c (cprop_into_stmt): Similarly.
  4152. (record_equivalences_from_stmt): Similarly.
  4153. * tree-ssa-live.c (create_ssa_var_map): Similarly.
  4154. (calculate_live_on_entry): Similarly.
  4155. * tree-ssa.c (mark_def_sites, rewrite_stmt): Similarly.
  4156. * tree-ssa-pre.c (process_left_occr_and_kills): Similarly.
  4157. * tree-inline.c (estimate_num_insns_1): Kill VDEF_EXPR.
  4158. * tree-pretty-print.c (dump_generic_node) Kill VDEF_EXPR.
  4159. (dump_vops): Dump VDEFs here.
  4160. * tree.c (build_vdef_expr): Kill.
  4161. * tree.h (build_vdef_expr): Kill prototype.
  4162. (VDEF_RESULT, VDEF_OP): Revamp to handle new method for recording
  4163. vdefs.
  4164. * tree.def (VDEF_EXPR): Kill.
  4165. * tree-cfg.c (cfg_remove_useless_stmts): Set both VAR and VAL to
  4166. NULL anytime one of them is determined to be invalid.
  4167. 2003-11-21 Andrew MacLeod <amacleod@redhat.com>
  4168. * tree-ssa-live.c (compact_var_map): Fix typo. Clear correct field.
  4169. (calculate_live_on_entry): Remove unneeded stmt.
  4170. * tree-ssa-live.h (version_to_var): New. Return variable associated
  4171. with a specific SSA version.
  4172. * tree-ssa.c (eliminate_build): Add check that ignored results don't
  4173. have important arguments. Allow ignored results.
  4174. (coalesce_abnormal_edges): Allow non-relevant results to be ignored.
  4175. (eliminate_extraneous_phis): Allow non-relevant results. Check that
  4176. no important arguments are being missed.
  4177. (coalesce_vars): Non-partition variables are allowed now, just ignored.
  4178. (rewrite_trees): New. Split out from rewrite_out_of_ssa. Perform tree
  4179. rewriting step.
  4180. (remove_ssa_form): New. Allow rewriting of just specified variables.
  4181. (rewrite_out_of_ssa): Use rewrite_trees and reorganize slightly to
  4182. accommodate typechecking in eliminate_extraneous_phis.
  4183. 2003-11-21 Jan Hubicka <jh@suse.cz>
  4184. * tree-dfa.c (get_expr_operands): Fix handling of CALL_EXPR.
  4185. * tree-must-alias.c (tree_compute_must_alias): promote pointers.
  4186. (find_addressable_vars): Deal with complex constant expressions;
  4187. do not clear may_point_to_global_mem.
  4188. 2003-11-21 Jan Hubicka <jh@suse.cz>
  4189. * parser.c (cp_parser_postfix_expression): Initialize 's' to
  4190. NULL_TREE.
  4191. 2003-11-20 Richard Henderson <rth@redhat.com>
  4192. * Makefile.in (bitmap.o-warn, caller-save.o-warn, combine.o-warn,
  4193. cgraphunit.o-warn, c-semantics.o-warn, emit-rtl.o-warn, expr.o-warn,
  4194. fold-const.o-warn, genattrtab.o-warn, regmove.o-warn, tree.o-warn,
  4195. varasm.o-warn, f/expr.o-warn, profile.o-warn): Remove.
  4196. * bitmap.c (bitmap_first_set_bit): Abort if no non-zero word found.
  4197. (bitmap_last_set_bit): Likewise.
  4198. * combine.c (get_pos_from_mask): Always set *plen.
  4199. 2003-11-20 Richard Henderson <rth@redhat.com>
  4200. * tree-dfa.c (get_expr_operands): Remove handling of PLUS_EXPR
  4201. inside INDIRECT_REF.
  4202. 2003-11-20 Diego Novillo <dnovillo@redhat.com>
  4203. * tree-nomudflap.c (nogo): Fix prototype.
  4204. 2003-11-20 Richard Henderson <rth@redhat.com>
  4205. * except.c (output_function_exception_table): Strip nops.
  4206. * gimplify.c (gimplify_addr_expr): Kill missing cast workaround.
  4207. (cpt_same_type, check_pointer_types_r): New.
  4208. (gimplify_body): Call it.
  4209. * tree-inline.c (insert_decl_map): New.
  4210. (remap_decl, remap_type, remap_block, copy_body_r,
  4211. initialize_inlined_parameters, declare_return_variable,
  4212. remap_save_expr, mark_local_for_remap_r): Use it.
  4213. 2003-11-20 Frank Ch. Eigler <fche@redhat.com>
  4214. libstdc++/11696
  4215. * c-pragma.c (handle_pragma_redefine_extname): Define always.
  4216. (init_pragma): Activate #pragma redefine_extname for mudflap.
  4217. * tree-inline.c (copy_tree_r): Propagate mf_marked-ness.
  4218. * tree-mudflap.c (mudflap_c_function): Break into new
  4219. _decls and _ops functions.
  4220. (mudflap_c_function_decls): Avoid unnecessary tree copying.
  4221. (mudflap_c_function_ops): Ditto. Gimplify explicitly only for
  4222. tree dumping.
  4223. * tree-nomudflap.c: Add new stub functions. Simplify error
  4224. message emission throughout.
  4225. * tree-mudflap.h: Corresponding changes.
  4226. * tree-optimize.c (tree_rest_of_compilation): Call the _decl
  4227. instrumentation before gimplification and ssa optimizations;
  4228. call the _ops instrumentation after ssa optimizations.
  4229. 2003-11-20 Diego Novillo <dnovillo@redhat.com>
  4230. Initial fix for PR optimization/12747
  4231. * Makefile.in (OBJS): Add tree-sra.o
  4232. * common.opt (ftree-sra): Add.
  4233. * flags.h (flag_tree_sra): Declare.
  4234. * gimplify.c (gimplify_addr_expr): Set TREE_INVARIANT
  4235. when producing and address expression for a DECL node.
  4236. * opts.c (decode_options): Enable SRA at -O1.
  4237. (common_handle_option): Handle -ftree-sra.
  4238. * timevar.def (TV_TREE_SRA): New timer.
  4239. * toplev.c (flag_tree_sra): Define.
  4240. * tree-cfg.c (stmt_ends_bb_p): Declare extern.
  4241. (bsi_replace): Add boolean argument to specify whether to
  4242. preserve EH region information. Update all callers.
  4243. (bsi_commit_edge_inserts): Also check the edge from ENTRY_BLOCK_PTR
  4244. to basic block 0.
  4245. Move loop body ...
  4246. (bsi_commit_edge_inserts_1): ... here.
  4247. * tree-dump.c: Add dump for SRA pass.
  4248. * tree.h (enum tree_dump_index): Modify accordingly.
  4249. (STRIP_USELESS_TYPE_CONVERSION): Define. Update all callers to
  4250. tree_ssa_useless_type_conversion.
  4251. * tree-eh.c (add_stmt_to_eh_region): New function.
  4252. * tree-flow.h (stmt_ends_bb_p): Declare.
  4253. (add_stmt_to_eh_region): Declare.
  4254. (tree_sra): Declare.
  4255. (enum bsi_iterator_update): Mirror entries in
  4256. enum tsi_iterator_update.
  4257. * tree-optimize.c (optimize_function_tree): Call SRA pass
  4258. after must-alias.
  4259. * tree-sra.c: New file.
  4260. * doc/invoke.texi: Document -ftree-sra and -fdump-tree-sra.
  4261. 2003-11-20 Andrew Macleod <amacleod@redhat.com>
  4262. * tree-ssa.c (check_replaceable): Return false if the LHS is a
  4263. DECL_HARD_REGISTER.
  4264. 2003-11-20 Diego Novillo <dnovillo@redhat.com>
  4265. * tree-ssa-ccp.c (set_rhs): Replace with an empty statement when
  4266. the replacement has no side effects.
  4267. 2003-11-20 Jeff Law <law@redhat.com>
  4268. * Makefile.in (OBJS-common): Kill tree-ssa-copyprop.o.
  4269. (tree-ssa-copyprop.o): Kill dependencies clause.
  4270. * common.opt (tree-copyprop): Kill option.
  4271. * flags.h (flag_tree_copyprop): Kill.
  4272. * opts.c (decode_options): Don't set flag_tree_copyprop.
  4273. (common_handle_option): Kill handling of -ftree-copyprop.
  4274. * timevar.def (TV_TREE_COPYPROP): Kill.
  4275. * toplev.c (flag_tree_copyprop): Kill.
  4276. (lang_independent_options): Kill -ftree-copyprop.
  4277. * tree-dump.c (dump_files): Kill .copyprop dump.
  4278. * tree-flow.h (tree_ssa_copyprop): Kill prototype.
  4279. (propagate_copy): Move prototype.
  4280. * tree-optimize.c (optimize_function_tree): Kill -ftree-copyprop stuff.
  4281. * tree.h (tree_dump_index): Kill TDI_copyprop.
  4282. * tree-ssa-copyprop.c: Kill.
  4283. * tree-ssa-dom.c (propagate_copy): Moved here from tree-ssa-copyprop.c.
  4284. * tree-ssanames.c (free_ssanames): No longer a varray.
  4285. (init_ssanames, make_ssa_name, release_ssa_name): Corresponding changes.
  4286. 2003-11-20 Steven Bosscher <stevenb@suse.de>
  4287. * tree-ssanames.c (ssanames_print_statistics): Use ISO function
  4288. declaration. Print unsigned ints, not usinged longs.
  4289. 2003-11-18 Daniel Berlin <dberlin@dberlin.org>
  4290. * tree-ssa-pre.c (rename_1): This should be static.
  4291. (append_eref_to_block): Don't gc allocate.
  4292. (clear_all_eref_arrays): Free the array rather than
  4293. clear them.
  4294. (rename_1): Ditto on both counts.
  4295. (free_expr_info): Free the arrays.
  4296. (collect_expressions): Don't gc allocate the arrays.
  4297. 2003-11-18 Daniel Berlin <dberlin@dberlin.org>
  4298. * tree-ssa-pre.c (insert_one_operand): Handle self-referential
  4299. ephi's properly.
  4300. 2003-11-19 Jeff Law <law@redhat.com>
  4301. * tree-ssa-dom.c (true_exprs, false_exprs): New hash tables.
  4302. (nonzero_vars): New varray.
  4303. (dom_walk_block_data): Add true_exprs, false_exprs and nonzero_vars.
  4304. (get_value_for, set_value_for): Accept additional argument indicating
  4305. which table to use. Callers updated.
  4306. (tree_ssa_dominator_optimize_1): Initialize and wipe our new hash
  4307. tables and varray appropriately.
  4308. (dom_opt_initialize_block): Initialize new block local varrays for
  4309. true expressions, false expressions and nonzero vars. Update call
  4310. to record_equivalences_from_incoming_edge.
  4311. (dom_opt_finalize_block): Put equivalences from taken edges
  4312. into the true_exprs and false_exprs hash tables. Restore global
  4313. state for true_exprs, false_exprs and nonzero_vars too.
  4314. (record_equivalences_from_incoming_edge): Accept dom_walk structure
  4315. instead of a gazillion varrays. Pass down block local
  4316. true_exprs, false_exprs and nonzero_vars varrays to various children.
  4317. (optimize_stmt): Accept block local nonzero_vars argument. Pass
  4318. new varrays down to record_equivalences_from_stmt.
  4319. (thread_jumps_walk_stmt): Pass new varrays down to
  4320. record_equivalences_from_stmt.
  4321. (dom_opt_walk_stmt): Pass new varrays down to optimize_stmt.
  4322. (dump_dominator_optimizer_statistics): Dump new hash tables.
  4323. (record_cond_is_true, record_cond_is_false): Record info into
  4324. the true/false hash tables/varrays instead of the main expression
  4325. varrays. Don't create useless tree nodes.
  4326. (record_var_is_nonzero): New function.
  4327. (record_equivalences_from_stmt): Don't generate useless tree nodes.
  4328. (lookup_avail_expr): Consult nonzero_vars and the true/false
  4329. expression tables as well.
  4330. (get_eq_expr_value): Record local true/false expressions in the
  4331. local true/false varrays rather than the main local expression
  4332. varray.
  4333. (true_false_expr_hash, true_false_expr_eq): New functions.
  4334. * Makefile.in (OBJS-sommon): Add tree-ssanames.o.
  4335. (tree-ssanames.o): Add dependencies.
  4336. * tree-dfa.c (remove_phi_node): Release SSA_NAME expression when
  4337. we remove the PHI node.
  4338. (remove_all_phi_nodes_for): Similarly.
  4339. * tree-ssa.c (prepare_operand_for_rename): Similarly when we
  4340. strip away an SSA_NAME expression from an operand.
  4341. (init_tree_ssa): Call the SSA_NAME initializer.
  4342. (delete_tree_ssa): Call the SSA_NAME finalizer.
  4343. * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): Clear the
  4344. const_and_copies and vrp_data virtual arrays.
  4345. * tree-ssanames.c: New file for management of SSA_NAME expressions.
  4346. * tree.h: Prototypes for functions exported by tree-ssanames.c.
  4347. * tree-flow.h, tree-ssa-ccp.c, tree-ssa-dce.c: Use highest_ssa_version
  4348. rather than next_ssa_version.
  4349. * tree-ssa-dom.c, tree-ssa-live.c, tree-ssa.c: Similarly.
  4350. * tree.c (dump_tree_statistics): Call into tree-ssaname statistics
  4351. dumper too.
  4352. (make_ssa_name): Kill. Now in tree-ssanames.c
  4353. 2003-11-18 Richard Henderson <rth@redhat.com>
  4354. * tree.c (recompute_tree_invarant_for_addr_expr): Split out from ...
  4355. (build1): ... here.
  4356. * tree.h: Declare it.
  4357. * gimplify.c (gimplify_addr_expr): Use it.
  4358. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Split out
  4359. from fold_indirect_refs_r.
  4360. (maybe_fold_stmt_indirect): Likewise.
  4361. (maybe_fold_offset_to_component_ref): New.
  4362. (maybe_fold_stmt_plus): New.
  4363. (fold_stmt_r): Rename from fold_indirect_refs_r.
  4364. (fold_stmt): Strip more useless type conversions.
  4365. 2003-11-18 Richard Henderson <rth@redhat.com>
  4366. * tree-cfg.c (dump_function_to_file): Mind when cfun is null.
  4367. 2003-11-18 Diego Novillo <dnovillo@redhat.com>
  4368. Revert
  4369. 2003-11-18 Jan Hubicka <jh@suse.cz>
  4370. * tree-cfg.c (cfg_remove_useless_stmts_bb): Avoid crash.
  4371. * tree-dfa.c (get_expr_operands): Fix handling of CALL_EXPR.
  4372. 2003-11-18 Jan Hubicka <jh@suse.cz>
  4373. * Makefile.in (sibcall.o): Kill.
  4374. (tree-tailcall.o): Add except.h dependency
  4375. * sibcall.c: Kill.
  4376. (purge_reg_equiv_notes, purge_mem_unchanging_flag): Move to ...
  4377. * calls.c (purge_reg_equiv_notes,
  4378. purge_mem_unchanging_flag) ... here.
  4379. (expand_call): Do not produce placeholders; do
  4380. not deal with tail recursion; update
  4381. equivalencies after sibcall production.
  4382. * toplev.c (rest_of_handle_sibling_calls): Kill.
  4383. (rest_of_compialtion): Do not use rest_of_handle_sibling_calls.
  4384. * tree-dump.c (dump_files): Add tail2
  4385. * tree-flow.h (tree_optimize_tail_calls): Update prototype.
  4386. * tree-optimize.c (optimize_function_tree): Do
  4387. tail optimization twice.
  4388. * tree-tailcall.c: Inlucde except.h
  4389. (suitable_for_tail_call_opt_p): New.
  4390. (optimize_tail_call): Add opt_tailcalls argument;
  4391. optimize tailcalls.
  4392. (tree_optimize_tail_calls): Add opt_tailcalls/pass arguments.
  4393. * tree.h (CALL_EXPR_TAILCALL): New.
  4394. (tree_dump_index): Add tail2
  4395. 2003-11-18 Jan Hubicka <jh@suse.cz>
  4396. * tree-cfg.c (cfg_remove_useless_stmts_bb): Avoid crash.
  4397. * tree-dfa.c (get_expr_operands): Fix handling of CALL_EXPR.
  4398. 2003-11-18 Diego Novillo <dnovillo@redhat.com>
  4399. * tree-optimize.c (optimize_function_tree): Disable tail
  4400. call optimizations.
  4401. 2003-11-18 Jan Hubicka <jh@suse.cz>
  4402. * Makefile.in (sibcall.o): Kill.
  4403. (tree-tailcall.o): Add except.h dependency
  4404. * sibcall.c: Kill.
  4405. (purge_reg_equiv_notes, purge_mem_unchanging_flag): Move to ...
  4406. * calls.c (purge_reg_equiv_notes, purge_mem_unchanging_flag) ... here.
  4407. (expand_call): Do not produce placeholders; do not deal with tail
  4408. recursion; update equivalencies after sibcall production.
  4409. * toplev.c (rest_of_handle_sibling_calls): Kill.
  4410. (rest_of_compialtion): Do not use rest_of_handle_sibling_calls.
  4411. * tree-dump.c (dump_files): Add tail2
  4412. * tree-flow.h (tree_optimize_tail_calls): Update prototype.
  4413. * tree-optimize.c (optimize_function_tree): Do tail optimization twice.
  4414. * tree-tailcall.c: Inlucde except.h
  4415. (suitable_for_tail_call_opt_p): New.
  4416. (optimize_tail_call): Add opt_tailcalls argument; optimize tailcalls.
  4417. (tree_optimize_tail_calls): Add opt_tailcalls/pass arguments.
  4418. * tree.h (CALL_EXPR_TAILCALL): New.
  4419. (tree_dump_index): Add tail2
  4420. 2003-11-18 Jeff Law <law@redhat.com>
  4421. * tree-ssa-dom.c (thread_across_edge): Lose block_avail_exprs argument.
  4422. Callers updated. Pass NULL for block_avail_exprs in call to
  4423. lookup_avail_expr. Record both the condition and the inverted
  4424. condition when threading across an edge.
  4425. 2003-11-18 Richard Henderson <rth@redhat.com>
  4426. * tree-ssa.c (tree_ssa_useless_type_conversion): Use TYPE_MAIN_VARIANT
  4427. when compariing pointer types too.
  4428. 2003-11-18 Jan Hubicka <jh@suse.cz>
  4429. * tree-dump.c (dump_files): Reorder tail calls.
  4430. * tree-optimize.c (optimize_function_tree): Likewise
  4431. * tree-tailcall.c (optimize_tail_call, eliminate_tail_call): Remove
  4432. variable tmpvars; update SSA.
  4433. (suitable_for_tail_opt_p): Do not give up because of static variables.
  4434. (find_tail_calls): Track return values in SSA graph.
  4435. * tree.c (make-phi_node): Do not create new SSA name when operand
  4436. already is.
  4437. * tree.h (enum tree_dump_index): Reorder tail call.
  4438. 2003-11-17 Diego Novillo <dnovillo@redhat.com>
  4439. * gimplify.c (gimplify_call_expr): Change gimple_test_f argument to
  4440. return bool type.
  4441. (mark_decls_volatile_r): New local function.
  4442. (gimplify_expr): Make gimple_test_f return bool type.
  4443. Call mark_decls_volatile_r when gimplifying VA_ARG_EXPR.
  4444. * tree-dfa.c (struct walk_state): Remove field is_va_arg_expr.
  4445. Update all callers.
  4446. (opf_force_vop): Remove. Update all users.
  4447. (add_stmt_operand): Re-structure to add real operands only for
  4448. GIMPLE register variables.
  4449. (find_vars_r): Don't handle VA_ARG_EXPR nodes.
  4450. (add_referenced_var): Also assign a UID to variables with hidden
  4451. uses.
  4452. Call is_gimple_call_clobbered to determine if a variable is call
  4453. clobbered.
  4454. (get_memory_tag_for): Mark memory tags volatile and static.
  4455. * tree-flow.h (struct var_ann_d): Remove field is_in_va_arg_expr.
  4456. Update all users.
  4457. * tree-simple.c (is_gimple_*): Change return type to bool. Update
  4458. all users.
  4459. (is_gimple_reg_type): Return true only for non aggregate types.
  4460. (is_gimple_non_addressable_1): New local function.
  4461. (is_gimple_reg): Call it.
  4462. (is_gimple_non_addressable): New function.
  4463. (is_gimple_call_clobbered): New function.
  4464. * tree-simple.h (is_gimple_*): Change return type to bool.
  4465. 2003-11-17 Jason Merrill <jason@redhat.com>
  4466. PR c++/11266
  4467. * gimplify.c (gimple_add_tmp_var): Also make sure
  4468. seen_in_bind_expr isn't set.
  4469. (mostly_copy_tree_r): Don't copy a TARGET_EXPR.
  4470. (gimplify_target_expr): Only expand a TARGET_EXPR the first time
  4471. we see it.
  4472. 2003-11-17 Richard Henderson <rth@redhat.com>
  4473. * tree-pretty-print.c (dump_generic_node): Use %u not %x for
  4474. printing DECL_UID.
  4475. 2003-11-16 Richard Henderson <rth@redhat.com>
  4476. * c-common.c (c_add_case_label): Use create_artificial_label.
  4477. * tree-simple.h (create_artificial_label): Move decl ...
  4478. * tree.h: ... here.
  4479. 2003-11-16 Richard Henderson <rth@redhat.com>
  4480. PR c++/12770
  4481. * gimple-low.c (lower_stmt_body): Take a tree, not a tree*.
  4482. (lower_stmt): Handle EH nodes.
  4483. (lower_bind_expr): Remove fixme.
  4484. (block_may_fallthru): Move from tree-eh.c. Handle COND_EXPR,
  4485. BIND_EXPR, and TRY_FINALLY_EXPR.
  4486. (lower_cond_expr): Use it.
  4487. * tree-eh.c (collect_finally_tree): Ignore COND_EXPR and BIND_EXPR.
  4488. (replace_goto_queue_cond_clause): New.
  4489. (replace_goto_queue_1): Use it. Split out statement_list handling.
  4490. (replace_goto_queue_stmt_list): New.
  4491. (-block_may_fallthru): Move to gimple-low.c.
  4492. (lower_eh_constructs_1): Ignore BIND_EXPR.
  4493. * tree-flow.h (block_may_fallthru): Declare.
  4494. * tree-dump.c (dump_files): Exchange .eh and .lower passes.
  4495. * tree-optimize.c (tree_rest_of_compilation): Likewise.
  4496. * tree.h (enum tree_dump_index): Likewise.
  4497. 2003-11-16 Jason Merrill <jason@redhat.com>
  4498. * gimplify.c (mostly_copy_tree_r): Don't walk into a BLOCK.
  4499. * tree-inline.c (walk_tree): Don't walk into the BIND_EXPR_VARS
  4500. of a BIND_EXPR.
  4501. * c-common.c (c_walk_subtrees): Don't walk into the decl of a
  4502. DECL_STMT.
  4503. PR optimization/11269
  4504. * dwarf2out.c (gen_subprogram_die): Generate a DIE for a named
  4505. return value.
  4506. (loc_descriptor_from_tree): Treat RESULT_DECL like VAR_DECL.
  4507. (add_location_or_const_value_attribute): Likewise.
  4508. (add_bound_info): Likewise.
  4509. (gen_decl_die): Likewise.
  4510. 2003-11-16 Jason Merrill <jason@redhat.com>
  4511. * c-pretty-print.c (debug_c_tree): Restore removed fn.
  4512. * diagnostic.h: Declare it.
  4513. * tree-pretty-print.c (dump_generic_node): Use DECL_UID when
  4514. dumping anonymous decls.
  4515. 2003-11-16 Richard Henderson <rth@redhat.com>
  4516. * tree-cfg.c (last_and_only_stmt): New.
  4517. * tree-flow.h (last_and_only_stmt): Declare.
  4518. * tree-ssa-dom.c (thread_across_edge): Use it.
  4519. * tree-cfg.c (tree_block_forwards_to): Don't check for empty stmts.
  4520. (tree_forwarder_block_p): Likewise.
  4521. * tree-dfa.c (get_stmt_operands): Likewise.
  4522. * tree-ssa-ccp.c (set_rhs): Likewise.
  4523. * tree-ssa-dom.c (optimize_stmt): Likewise.
  4524. * tree-ssa.c (rewrite_stmt): Likewise.
  4525. 2003-11-16 Richard Henderson <rth@redhat.com>
  4526. * tree.h (LABEL_DECL_UID): Rename from LABEL_DECL_INDEX.
  4527. * tree-flow.h (bsi_remove): Declare.
  4528. * tree-flow-inline.h (bsi_remove): Move ...
  4529. * tree-cfg.c (set_bb_for_stmt): Don't re-set LABEL_DECL_UID.
  4530. Verify that a label isn't already in a block before adding it.
  4531. (bsi_remove): Move from tree-flow-inline.h, clear bb.
  4532. * tree-pretty-print.c (dump_generic_node): Use LABEL_DECL_UID if set.
  4533. 2003-11-15 Richard Henderson <rth@redhat.com>
  4534. * function.c (clear_block_marks): Rename from reorder_blocks_0, export.
  4535. * function.h (clear_block_marks): Declare.
  4536. * gimple-low.c (lower_function_body): Use it.
  4537. (lower_bind_expr): Ensure we don't link blocks into the tree twice.
  4538. * gimplify.c (gimplify_body): Keep old bind_expr at top level if
  4539. possible.
  4540. 2003-11-14 Richard Henderson <rth@redhat.com>
  4541. * tree-ssa-pre.c (split_critical_edges): Reimplement. Call
  4542. tree_split_edge directly.
  4543. 2003-11-14 Jason Merrill <jason@redhat.com>
  4544. * tree-eh.c (do_return_redirection): Assign directly to the
  4545. RESULT_DECL of a function which returns in memory.
  4546. 2003-11-14 Daniel Berlin <dberlin@dberlin.org>
  4547. * tree-ssa-pre.c (pre_stats): Add ephis_current member.
  4548. (create_ephi_node): Use xmalloc, not ggc_alloc_tree.
  4549. (clear_all_eref_arrays): Free the ephis here.
  4550. (expr_phi_insertion): Don't append the ephis to the erefs array.
  4551. (insert_occ_in_preorder_dt_order): Move building/freeing of dfn
  4552. array so that it only occurs once per function..
  4553. (rename_1): Ditto on the dfs_id array.
  4554. (ephi_use_pool): New alloc pool.
  4555. (add_ephi_use): Pool allocate these things, rather than
  4556. ggc_alloc'ing them.
  4557. (insert_euse_in_preorder_dt_order_1): Use ephi_at_block to put the
  4558. ephi in the list.
  4559. (pre_expression): Don't PRE when we only have 1 occurrence.
  4560. (expr_lexically_eq): Make inline.
  4561. (names_match_p): Move closer to first use.
  4562. (tree_perform_ssapre): Alloc and free the ephi_use_pool.
  4563. Make stat printing per-expression.
  4564. Add checking that we freed all ephis.
  4565. 2003-11-14 Andrew MacLeod <amacleod@redhat.com>
  4566. * common.opt (ftree-ter): Document new option.
  4567. * flags.h (flag_tree_ter): Add new flag.
  4568. * fold-const.c (invert_truthvalue): Don't ignore cast to BOOLEAN_TYPE.
  4569. * opts.c (decode_options): Option -ftree-ter defaults to on.
  4570. (common_handle_option): Add processing for flag_tree_ter.
  4571. * toplev.c (flag_tree_ter): Initialize to 0.
  4572. (lang_independent_options f_): Add -ftree-ter flag.
  4573. * tree-ssa-live.c (init_var_map): Initialize ref_count to 0.
  4574. (delete_var_map): Free ref count if allocated.
  4575. (register_ssa_partition): Add "is_use" parameter for reference counting.
  4576. (create_ssa_var_map): Add flag and code for calculating ref counts.
  4577. * tree-ssa-live.h (struct _var_map): Add ref_count field.
  4578. (SSA_VAR_MAP_REF_COUNT): Define flag.
  4579. (version_ref_count): Function to retreive ref_count.
  4580. * tree-ssa.c (replace_variable): If an expression vector is passed in,
  4581. use replacement expression instead of mapped variable when available.
  4582. (struct value_expr_d): New structure for value lists.
  4583. (struct temp_expr_table_d): Structure used to build an expression
  4584. replacement table.
  4585. (new_temp_expr_table): New. Create a new TER (Temporary Expression
  4586. Replacement) table.
  4587. (free_temp_expr_table): New. Free a TER table.
  4588. (new_value_expr): New. Allocate a value list element.
  4589. (free_value_expr): New. Free a value list element.
  4590. (find_value_in_list): New. Find a value in a list.
  4591. (add_value_to_list): New. Add a value to a list if not already present.
  4592. (remove_value_from_list): New. Remove a value from a list.
  4593. (add_dependance): New. Add a dependency to an expression.
  4594. (check_replaceable): New. Check if a stmt is a candidate for TER. Add
  4595. to active list and create dependancies if so.
  4596. (finish_expr): New. Remove an expression from TER consideration.
  4597. (mark_replaceable): New. Finish a TER expression as a valid replacement.
  4598. (kill_expr): New. Finish dependent TER expressions as not replaceable.
  4599. (kill_virtual_exprs): New. Finish any TER expressions dependent on a
  4600. virtual operand as not replaceable.
  4601. (find_replaceable_in_bb): New. Process a basic block for TER expression.
  4602. (find_replaceable_exprs): New. Entry point for TER expression finder.
  4603. (dump_replaceable_exprs): New. output list of replaceable expressions.
  4604. (rewrite_out_of_ssa): Build TER table if requested, and use it.
  4605. 2003-11-14 Andreas Jaeger <aj@suse.de>
  4606. * c-semantics.c (find_reachable_label): Use C90 function
  4607. declaration.
  4608. 2003-11-14 Jason Merrill <jason@redhat.com>
  4609. PR middle-end/12526
  4610. * tree-cfg.c (call_expr_flags): Move to calls.c.
  4611. * tree-flow.h: Move prototype to tree.h.
  4612. PR c++/13033
  4613. * c-simplify.c (gimplify_c_loop): Wrap the increment in a
  4614. CLEANUP_POINT_EXPR.
  4615. * tree-dfa.c (get_stmt_operands) <ASM_EXPR>: A memory clobber
  4616. clobbers all call-clobbered variables. Clobber clobber.
  4617. * gimplify.c (canonicalize_component_ref): Remove redundant call
  4618. to recalculate_side_effects.
  4619. 2003-11-14 Richard Henderson <rth@redhat.com>
  4620. PR c++/12751
  4621. * tree-eh.c (struct leh_tf_state): Add outer.
  4622. (lower_try_finally, lower_cleanup): Set it.
  4623. (lower_try_finally_fallthru_label): New.
  4624. (honor_protect_cleanup_actions): Use it.
  4625. (lower_try_finally_copy, lower_try_finally_switch): Likewise.
  4626. * tree-eh.c (collect_finally_tree): Complete manual tailrecurse
  4627. transformation.
  4628. 2003-11-14 Richard Henderson <rth@redhat.com>
  4629. * gimplify.c (voidify_wrapper_expr): Don't clobber TREE_TYPE of
  4630. statements in a STATEMENT_LIST. Be prepared for an empty list.
  4631. 2003-11-14 Steven Bosscher <stevenb@suse.de>
  4632. * jump.c (never_reached_warning): Remove function.
  4633. * rtl.h (never_reached_warning): Don't declare it.
  4634. * cfgrtl.c (never_reached_warning): Don't call it.
  4635. * cse.c (never_reached_warning): Ditto.
  4636. 2003-11-13 Jeff Law <law@redhat.com>
  4637. * tree-cfg.c (bsi_replace): Restore accidentally removed code.
  4638. * tree-cfg.c (cfg_remove_useless_stmts_bb): Also detect useless
  4639. var->var copies created by the out-of-ssa translation.
  4640. 2003-11-13 Steven Bosscher <stevenb@suse.de>
  4641. PR middle-end/11514
  4642. * tree-inline.c (walk_tree): Handle PLACEHOLDER_EXPR.
  4643. 2003-11-13 Richard Henderson <rth@redhat.com>
  4644. * tree-cfg.c (cfg_remove_useless_stmts_bb): Initialize stmt.
  4645. 2003-11-13 Jan Hubicka <jh@suse.cz>
  4646. * calls.c (special_function_p): Do not check for ECF_MALLOC.
  4647. (flags_from_decl_or_type): Use special_function_p.
  4648. (expand_call): Remove call to special_function_p.
  4649. * tree-cfg.c (notice_special_calls, clear_special_calls): New functions.
  4650. (remove_useless_stmts): Use clear_special_calls.
  4651. (remove_useless_stmts_1): Use notice_special_calls.
  4652. * tree-flow.h (notice_special_calls, clear_special_calls): New functions.
  4653. * tree-ssa-dce.c (remove_dead_stmts): Use clear_special_calls and
  4654. notice_special_calls..
  4655. * gimplify.c (gimplify_expr): Check labels.
  4656. * tree-cfg.c (tree_verify_flow_info): Check labels.
  4657. * tree-cfg.c (make_exit_edges): Do not create edges for const
  4658. functions.
  4659. (update_call_expr_flags): Fix.
  4660. 2003-11-12 Diego Novillo <dnovillo@redhat.com>
  4661. (declare_inlined_vars): New local function.
  4662. (initialize_inlined_parameters): Call it.
  4663. (expand_call_inline): Call it.
  4664. 2003-11-13 Steven Bosscher <stevenb@suse.de>
  4665. PR optimization/12640
  4666. * tree-ssa-ccp.c (get_strlen): Don't follow the UD chain
  4667. of a PHI argument if the DEF stmt for the argument is
  4668. the PHI itself.
  4669. 2003-11-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  4670. Jeff Law <law@redhat.com>
  4671. * tree-cfg.c (cfg_remove_useless_stmts): New function.
  4672. (cfg_remove_useless_stmts_bb): Likewise.
  4673. * tree-flow.h (cfg_remove_useless_stmts): Prototype.
  4674. * tree-ssa.c (rewrite_out_of_ssa): Use cfg_remove_useless_stmts
  4675. instead of remove_useless_stmts.
  4676. 2003-11-12 Richard Henderson <rth@redhat.com>
  4677. * Makefile.in (OBJS-common): Add tree-iterator.o.
  4678. (expr.o): Depend on tree-iterator.h.
  4679. (GTFILES): Add tree-iterator.c.
  4680. * basic-block.h (struct basic_block_def): Replace head_tree_p
  4681. and end_tree_p with stmt_list.
  4682. (tree_bb_root): New.
  4683. (create_bb): Don't declare.
  4684. * c-common.c (c_warn_unused_result): Handle STATEMENT_LIST.
  4685. * c-simplify.c (c_gimplify_stmt): Don't rationalize_compound_expr.
  4686. * cfg.c (entry_exit_blocks): Adjust for member changes.
  4687. (compact_blocks): Manage tree_bb_root.
  4688. * expr.c (expand_expr_1): Handle STATEMENT_LIST.
  4689. * gimple-low.c: Update for tree_stmt_iterator changes.
  4690. (lower_cond_expr): Use expr_only. Notice empty conditionals.
  4691. * gimplify.c (append_to_statement_list_1): Create and
  4692. manage statement_list nodes.
  4693. (foreach_stmt): Remove.
  4694. (wfl_locus): Remove.
  4695. (annotate_all_with_locus_1): Merge into...
  4696. (annotate_all_with_locus): ... here. Iterate over the
  4697. statement list directly.
  4698. (voidify_wrapper_expr): Handle STATEMENT_LIST.
  4699. (gimplify_return_expr): Likewise.
  4700. (gimplify_loop_expr): Likewise.
  4701. (shortcut_cond_r, shortcut_cond_expr): Likewise.
  4702. (gimplify_cleanup_point_expr): Likewise.
  4703. (gimple_build_eh_filter): Create statement list bodies.
  4704. (gimplify_bind_expr): Likewise.
  4705. (gimplify_switch_expr): Likewise.
  4706. (gimplify_cond_expr): Likewise.
  4707. (gimplify_compound_expr): Handle void expressions as well.
  4708. (gimplify_statement_list): New.
  4709. (gimple_push_cleanup): Gimplify the WITH_CLEANUP_EXPR operand.
  4710. (gimplify_stmt): Ensure non-null result.
  4711. (gimplify_to_stmt_list): New.
  4712. (gimplify_expr): Use gimplify_compound_expr, gimplify_statement_list,
  4713. gimplify_to_stmt_list as appropriate.
  4714. (gimplify_body): Fix creation of outer BIND_EXPR.
  4715. * tree-cfg.c (tree_bb_root): New.
  4716. (build_tree_cfg): Initialize it. Update for make_blocks changes.
  4717. (factor_computed_gotos): Use create_bb directly.
  4718. (make_blocks): Rewrite to use statement lists.
  4719. (append_stmt_to_bb, prepend_stmt_to_bb): Remove.
  4720. (create_bb): Make static. Add stmt_list argument. Don't allow
  4721. null after argument. Set tree_bb_root.
  4722. (make_edges): ENTRY block successor is FALLTHRU.
  4723. (remove_useless_stmts_warn_notreached): Handle STATEMENT_LIST.
  4724. (struct rus_data): Add last_goto.
  4725. (remove_useless_stmts_cond): Clear it. Zap empty conditionals.
  4726. Use expr_only for simple statment elimination.
  4727. (remove_useless_stmts_tf): Clear last_goto. Use TREE_SIDE_EFFECTS
  4728. instead of IS_EMPTY_STMT. Use append_to_statement_list instead of
  4729. munging to COMPOUND_EXPR.
  4730. (remove_useless_stmts_tc): Clear last_goto. Use TREE_SIDE_EFFECTS.
  4731. (remove_useless_stmts_goto): Set last_goto.
  4732. (remove_useless_stmts_label): New. Kill goto-next-label.
  4733. (remove_useless_stmts_1): Reorg to handle STATEMENT_LIST.
  4734. (remove_bb): Simplify block removal.
  4735. (remove_bsi_from_block): Kill.
  4736. (tree_block_forwards_to): Tidy bsi loops. Do not create
  4737. block label here.
  4738. (tree_cfg2dot): Update for bb->stmt_list.
  4739. (delete_tree_cfg): Clear tree_bb_root.
  4740. (set_bb_for_stmt): Handle STATEMENT_LISTs.
  4741. (bsi_insert_before, bsi_insert_after): Re-implement on TSIs.
  4742. (bsi_move_after, bsi_move_before, bsi_move_to_bb_end): Likewise.
  4743. (bsi_replace): Likewise.
  4744. (tree_find_edge_insert_loc): New, split from ...
  4745. (bsi_insert_on_edge_immediate): ... here.
  4746. (bsi_commit_edge_inserts): Use it. Add all stmts at once.
  4747. (bsi_insert_on_edge): Use statement lists.
  4748. (tree_split_edge): Position new block correctly. Deal with
  4749. fallthrough to EXIT.
  4750. (tree_verify_flow_info): Do not check block order vs statement chain.
  4751. (tree_make_forwarder_block): Update create_bb call, fix edge flags.
  4752. (thread_jumps): Call tree_redirect_edge_and_branch directly.
  4753. (tree_block_label): Don't return a NONLOCAL_LABEL.
  4754. (tree_redirect_edge_and_branch_1): Rename from s/_1//. Take an
  4755. argument to use ssa_redirect_edge or redirect_edge_succ. Use
  4756. tree_split_edge instead of bsi_insert_on_edge_immediate.
  4757. (tree_redirect_edge_and_branch): New.
  4758. (remove_stmt, first_exec_stmt, bsi_init, bsi_next_in_bb): Kill.
  4759. (bsi_start, bsi_last, bsi_prev, bsi_from_tsi): Kill.
  4760. (bsi_update_from_tsi, bsi_link_after): Kill.
  4761. * tree-eh.c (collect_finally_tree): Handle STATEMENT_LIST.
  4762. (replace_goto_queue_1): Likewise.
  4763. (replace_goto_queue): Don't use walk_tree.
  4764. (do_return_redirection): Create statement lists.
  4765. (do_goto_redirection): Likewise.
  4766. (block_may_fallthru_last): Fold into...
  4767. (block_may_fallthru): ... here.
  4768. (frob_into_branch_around): Use append_to_statement_list.
  4769. (honor_protect_cleanup_actions): Likewise.
  4770. (lower_try_finally_nofallthru): Likewise.
  4771. (lower_try_finally_onedest): Likewise.
  4772. (lower_try_finally_copy): Likewise.
  4773. (lower_try_finally_switch): Likewise.
  4774. (lower_try_finally): Likewise.
  4775. (lower_catch): Likewise.
  4776. (lower_eh_filter): Likewise.
  4777. (lower_eh_constructs_1): Handle STATEMENT_LIST.
  4778. * tree-flow-inline.h (BSI_NUM_ELEMENTS, bsi_list_p): Remove.
  4779. (new_bsi_list, empty_bsi_stack, FOR_EACH_BSI_IN_REVERSE): Remove.
  4780. (FOR_EACH_STMT_IN_REVERSE): Remove.
  4781. (bsi_start, bsi_last, bsi_end_p): Re-implement based on TSIs.
  4782. (bsi_next, bsi_prev, bsi_stmt, bsi_stmt_ptr, bsi_remove): Likewise.
  4783. * tree-flow.h (block_stmt_iterator): Likewise.
  4784. * tree-inline.c (copy_statement_list): New.
  4785. (copy_body_r): Use it, and append_to_statement_list.
  4786. (initialize_inlined_parameters): Use append_to_statement_list.
  4787. (expand_call_inline): Likewise.
  4788. (gimple_expand_calls_inline): New.
  4789. (expand_calls_inline): Use it.
  4790. (walk_tree, unsave_r): Handle STATEMENT_LIST.
  4791. (add_stmt_to_compound): Remove.
  4792. * tree-iterator.c: New file.
  4793. * tree-iterator.h: Re-implement based on STATEMENT_LIST.
  4794. * tree-mudflap.c (mf_decl_cache_locals): Don't
  4795. rationalize_compound_expr.
  4796. * tree-optimize.c (optimize_function_tree): Make static.
  4797. Rechain statements from blocks before deleting the cfg.
  4798. * tree-pretty-print.c (dump_generic_node): Handle STATEMENT_LIST,
  4799. update for change in tree_stmt_iterator wrt COMPOUND_EXPR.
  4800. (dump_generic_node): Dump lowered COND_EXPR on a single line.
  4801. * tree-simple.c (is_gimple_stmt): Handle STATEMENT_LIST.
  4802. * tree-simple.h (foreach_stmt_fn, foreach_stmt): Remove.
  4803. (gimplify_to_stmt_list): Declare.
  4804. (alloc_stmt_list, free_stmt_list): Declare.
  4805. * tree-ssa-dce.c (should_remove_dead_stmt): Rename from
  4806. remove_dead_stmt; return bool if statement should be removed.
  4807. (remove_dead_stmts): Update to match.
  4808. * tree-ssa-live.c (build_tree_conflict_graph): Don't use
  4809. FOR_EACH_STMT_IN_REVERSE.
  4810. * tree-ssa-pre.c (reaching_def): Tidy BSI usage.
  4811. (insert_one_operand, collect_expressions): Likewise.
  4812. * tree.c (tree_size): Handle STATEMENT_LIST.
  4813. (copy_node): Abort on STATEMENT_LIST.
  4814. (expr_first, expr_last): Move to tree-iterator.c.
  4815. (expr_length): Remove.
  4816. (tree_node_structure): Handle STATEMENT_LIST.
  4817. (tsi_link_before, tsi_link_after, tsi_delink): Move to tree-iterator.c.
  4818. (tsi_link_chain_before, tsi_link_chain_after): Merge into non-chain.
  4819. (tsi_new_stmt_list, tsi_stmt_list_head, body_is_empty): Kill.
  4820. * tree.def (STATEMENT_LIST): New.
  4821. * tree.h (STATEMENT_LIST_HEAD, STATEMENT_LIST_TAIL): New.
  4822. (struct tree_statement_list_node): New.
  4823. (struct tree_statement_list): New.
  4824. (enum tree_node_structure_enum): Add TS_STATEMENT_LIST.
  4825. (union tree_node): Add stmt_list.
  4826. (expr_length): Remove.
  4827. (expr_only): New.
  4828. (add_to_compound_expr, body_is_empty): Remove.
  4829. (optimize_function_tree): Remove.
  4830. 2003-11-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  4831. * tree-flow.h (remove_useless_vars): Declare.
  4832. (expand_var_p): Declaration removed.
  4833. * tree-ssa.c (rewrite_out_of_ssa): Call remove_useless_vars.
  4834. * tree-cfg.c (dump_function_to_file): Update dumping of variables.
  4835. * gimple-low.c (expand_var_p): Made static.
  4836. (remove_useless_vars): New.
  4837. (expand_used_vars): Expand all variables in the
  4838. cfun->unexpanded_var_list.
  4839. 2003-11-11 Richard Henderson <rth@redhat.com>
  4840. * c-common.c (c_gimplify_stmt): Fix botched removal of
  4841. rationalize_compound_expr calls.
  4842. * c-semantics.c (build_stmt): Set TREE_SIDE_EFFECTS.
  4843. * c-simplify.c (c_gimplify_stmt): Return a gimplify_status;
  4844. mind the status from subroutines to avoid re-gimplification.
  4845. (c_build_bind_expr): Do not call gimplify_stmt.
  4846. (gimplify_c_loop): Don't create a loop_expr; fully gimplify.
  4847. (gimplify_block, gimplify_cleanup, gimplify_expr_stmt,
  4848. gimplify_for_stmt, gimplify_while_stmt, gimplify_do_stmt,
  4849. gimplify_if_stmt, gimplify_switch_stmt, gimplify_return_stmt,
  4850. gimplify_decl_stmt, gimplify_compound_literal_expr,
  4851. gimplify_stmt_expr): Return a gimplify_status. In most cases,
  4852. don't do local gimplification of sub-structures.
  4853. (gimplify_decl_stmt): Use append_to_compound_expr when we care
  4854. about the result value.
  4855. (gimplify_stmt_expr): Use append_to_statement_list_force and
  4856. re-gimplify so that voidify_wrapper_expr can work.
  4857. (finish_bc_block): Don't append to a non-list.
  4858. (c_gimplify_expr): Pass back the gimplify_status of subroutines.
  4859. * c-common.h (c_gimplify_stmt): Update decl.
  4860. * gimplify.c (append_to_statement_list_1): Make sure list_p is
  4861. never null after call.
  4862. (append_to_compound_expr): New.
  4863. * tree-simple.h (append_to_compound_expr): Declare.
  4864. 2003-11-11 Richard Henderson <rth@redhat.com>
  4865. * gimplify.c (gimplify_addr_expr): Clear, not copy, TREE_SIDE_EFFECTS.
  4866. 2003-11-11 Richard Henderson <rth@redhat.com>
  4867. PR c/13014
  4868. * c-simplify.c (gimplify_if_stmt): Remove short circuit.
  4869. * tree-cfg.c (struct rus_data): Add has_label.
  4870. (remove_useless_stmts_warn_notreached): New.
  4871. (remove_useless_stmts_cond): Warn for deleted conditionals.
  4872. (remove_useless_stmts_tc): Warn for deleted catches.
  4873. (remove_useless_stmts_1): Set has_label.
  4874. 2003-11-11 Jan Hubicka <jh@suse.cz>
  4875. * gimplify.c (gimplify_call_expr): Unset side effects for
  4876. pure functions too.
  4877. * tree-cfg.c (update-call_expr_flags): New function.
  4878. (remove_useless_stmts_and_vars_1): Use it.
  4879. (is_ctrl_altering_stmt): Pure/const calls never alter the CFG.
  4880. * tree-ssa-dce.c (stmt_useful_p): Check side effects flag
  4881. on call exprs.
  4882. 2003-11-11 Jan Hubicka <jh@suse.cz>
  4883. * tree-cfg.c (has_label_p): New function.
  4884. (tree_verify_flow_info): New checks.
  4885. * tree-optimize.c (optimize_function_tree): Call verify_flow_info
  4886. before de-SSA.
  4887. 2003-11-11 Richard Henderson <rth@redhat.com>
  4888. * tree-cfg.c (struct rus_data): Rename from rusv_data.
  4889. Remove remove_unused_vars.
  4890. (remove_useless_stmts*): Rename from remove_useless_stmts_and_vars*.
  4891. (remove_useless_stmts_bind): Do not remove dead variables.
  4892. (remove_useless_stmts): Kill remove_unused_vars argument.
  4893. * tree-flow.h (remove_useless_stmts): Update.
  4894. * tree-optimize.c (tree_rest_of_compilation): Update call.
  4895. * tree-ssa.c (rewrite_out_of_ssa): Likewise.
  4896. 2003-11-11 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  4897. Diego Novillo <dnovillo@redhat.com>
  4898. * basic-block.h (brief_dump_cfg): Declare.
  4899. * cfg.c (dump_cfg_bb_info, brief_dump_cfg): New.
  4900. * diagnostic.h (dump_generic_node): Declaration changed.
  4901. (print_generic_stmt_indented): Declare.
  4902. * gimple-low.c (expand_var_p): New.
  4903. (expand_used_vars): Use it.
  4904. * tree-cfg.c (struct cfg_stats_d): Remove num_failed_bind_expr_merges
  4905. field.
  4906. (remove_bb): Only dump whole block with TDF_DETAILS.
  4907. (tree_dump_bb): Use dump_generic_bb.
  4908. (dump_tree_cfg): Use brief_dump_cfg and dump_function_to_file.
  4909. (dump_cfg_function_to_file): Merged into dump_function_to_file,
  4910. removed.
  4911. (dump_cfg_stats): Do not dump cfg_stats.num_failed_bind_expr_merges.
  4912. (dump_function_to_file): Moved from tree-dump.c, merged with
  4913. dump_cfg_function_to_file.
  4914. * tree-dump.c (dump_function_to_file): Removed.
  4915. * tree-flow.h (dump_cfg_function_to_file): Declaration removed.
  4916. (dump_generic_bb, expand_var_p): Declare.
  4917. * tree-must-alias.c (tree_compute_must_alias): Replace
  4918. dump_cfg_function_to_file by dump_function_to_file.
  4919. * tree-ssa-ccp.c (tree_ssa_ccp): Ditto.
  4920. * tree-ssa-copyprop.c (tree_ssa_copyprop): Ditto.
  4921. * tree-ssa-dce.c (tree_ssa_dce): Ditto.
  4922. * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): Ditto.
  4923. * tree-ssa-pre.c (tree_perform_ssapre): Ditto.
  4924. * tree-ssa.c (rewrite_into_ssa, rewrite_out_of_ssa): Ditto.
  4925. * tree-tailcall.c (tree_optimize_tail_calls): Ditto.
  4926. * tree-pretty-print.c (print_declaration, print_generic_decl): Don't
  4927. use flags argument, change spacing.
  4928. (dump_block_info): Removed.
  4929. (dump_generic_bb_buff, dump_generic_bb, print_generic_stmt_indented,
  4930. dump_bb_header, dump_bb_end, dump_phi_nodes): New functions.
  4931. (dump_vops): Change spacing, don't dump phi nodes.
  4932. (do_niy, print_generic_stmt, print_generic_expr, print_declaration,
  4933. print_struct_decl, print_call_name): Add argument to
  4934. the dump_generic_node calls.
  4935. (last_bb): Removed.
  4936. (dump_generic_node): Print semicolons at end of statements correctly.
  4937. Don't print bb related stuff.
  4938. (maybe_init_pretty_print): Don't initialize last_bb.
  4939. * tree-ssa.c (rewrite_out_of_ssa): Do not allow virtual operands to
  4940. be shown in the .optimized dump.
  4941. 2003-11-11 Daniel Berlin <dberlin@dberlin.org>
  4942. PR optimization/12936
  4943. * tree-ssa-pre.c (expr_phi_insertion): Remove unused code that was
  4944. causing ICE's for VA_ARG_EXPR.
  4945. 2003-11-10 Richard Henderson <rth@redhat.com>
  4946. * gimple-low.c (lower_function_body): Lower bind_expr in place.
  4947. (lower_stmt): Only incr for stmts we're skipping.
  4948. (lower_cond_expr): Detect empty if.
  4949. 2003-11-10 Steven Bosscher <stevenb@suse.de>
  4950. * toplev.c (rest_of_decl_compilation): Use the location of the
  4951. declaration for error messages.
  4952. 2003-11-10 Richard Henderson <rth@redhat.com>
  4953. * gimplify.c (add_stmt_to_compound, add_tree): Remove.
  4954. (append_to_statement_list_1, append_to_statement_list): New.
  4955. (append_to_statement_list_force): New.
  4956. (gimplify_loop_expr): Take pre_p.
  4957. (gimplify_expr): Provide it.
  4958. * tree-simple.h: Update.
  4959. * c-simplify.c: Replace add_tree with append_to_statement_list.
  4960. * gimplify.c, tree-mudflap.c: Likewise.
  4961. 2003-11-10 Richard Henderson <rth@redhat.com>
  4962. * c-common.c (c_warn_unused_result): Restructure to use iterator
  4963. on COMPOUND_EXPR only.
  4964. 2003-11-09 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  4965. * tree-cfg.c (tree_verify_flow_info): Fix checking of order of basic
  4966. blocks over code.
  4967. 2003-11-09 Richard Henderson <rth@redhat.com>
  4968. * basic-block.h (struct edge_def): Turn insns into a union.
  4969. * cfgrtl.c (insert_insn_on_edge): Update to match.
  4970. (commit_one_edge_insertion, commit_edge_insertions): Likewise.
  4971. (commit_edge_insertions_watch_calls): Likewise.
  4972. * gcse.c (reg_killed_on_edge, bypass_block): Likewise.
  4973. * profile.c (instrument_edges): Likewise.
  4974. * rtlanal.c (hoist_insn_to_edge): Likewise.
  4975. * tree-cfg.c (PENDING_STMT): Likewise.
  4976. (SET_PENDING_STMT): Remove.
  4977. (bsi_commit_edge_inserts): Update to match.
  4978. 2003-11-08 Jan Hubicka <jh@suse.cz>
  4979. * fold.c (nondestructive_fold_binary_to_constant): Fix typo.
  4980. * fold-const.c (fold_relational_const): Check for side effects.
  4981. 2003-11-07 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  4982. * basic-block.h (create_bb): Declaration changed.
  4983. * tree-cfg.c (create_bb): Enable creating a block on specified place.
  4984. (make_blocks, tree_split_edge, tree_make_forwarder_block): Use it.
  4985. (tree_verify_flow_info): Check bbs are in the correct order.
  4986. * tree-cfg.c (find_unreachable_blocks): Remove now incorrect comments.
  4987. * tree-ssa.c (rewrite_out_of_ssa): Don't remove annotations from
  4988. statements before the final dump.
  4989. 2003-11-07 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  4990. * tree-tailcall.c (struct tailcall): New.
  4991. (bb_optimize_tail_calls, find_tail_call_p): Removed.
  4992. (eliminate_tail_call): Get the tailcall from the struct tailcall.
  4993. (optimize_tail_call, find_tail_calls): New.
  4994. (tree_optimize_tail_calls): Use them.
  4995. 2003-11-07 Jan Hubicka <jh@suse.cz>
  4996. * gimple-low.c (simple_goto_p): Move to...
  4997. * tree-cfg.c: (simple_goto_p): ... here;
  4998. (nonlocal_goto_p): New.
  4999. (is_computed_goto): Rename to ...
  5000. (computed_goto_p): ... this; make global.
  5001. (factor_computed_gotos, make_blocks): Update calls.
  5002. (make_ctrl_stmt_edges): Add edge for nonlocal labels; use new functions.
  5003. * tree-flow.h (is_coputed_goto): Kill.
  5004. (nonlocal_goto_p, simple_goto_p, computed_goto_p): Declare.
  5005. * tree-ssa-ccp (visit_stmt): Update.
  5006. 2003-11-07 Jan Hubicka <jh@suse.cz>
  5007. * fold-const.c (tree_expr_nonzero_p): Fix typo.
  5008. * fold-const.c (tree_expr_nonzero_p): New function.
  5009. (fold_relational_const): Use it.
  5010. (nondestructive_fold_binary_to_constant): Allow casts in address
  5011. expressions.
  5012. 2003-11-06 Jan Hubicka <jh@suse.cz>
  5013. * tree-cfg.c (tree_block_label): Cleanup.
  5014. 2003-11-06 Daniel Berlin <dberlin@dberlin.org>
  5015. * tree-ssa-pre.c (fast_a_dominates_b): New function.
  5016. (build_dfs_id_array_1): Ditto.
  5017. (build_dfs_id_array): Ditto.
  5018. (load_modified_phi_result): Use fast_a_dominates_b.
  5019. (rename_1): Ditto.
  5020. Also use build_dfs_id_array, and remove some duplicate ephi_at_block
  5021. calls.
  5022. (insert_occ_in_preorder_dt_order): Remove some duplicate ephi_at_block
  5023. calls.
  5024. (pre_expression): Ditto.
  5025. Also free dfs_id arrays here.
  5026. (collect_expressions): Remove duplicate bsi_stmt calls.
  5027. 2003-11-06 Daniel Berlin <dberlin@dberlin.org>
  5028. * tree-ssa-pre.c (count_stmts_in_bb): Removed.
  5029. (set_var_phis): Only call bb_for_stmt once.
  5030. (insert_one_operand): Remove endtree, endtreep, a lot of special handling
  5031. no longer needed. Remove insert_done.
  5032. (collect_expressions): Enable INDIRECT_REF and SSA_NAME handling.
  5033. 2003-11-06 Steven Bosscher <stevenb@suse.de>
  5034. * tree-cfg.c (STRIP_CONTAINERS): Remove.
  5035. 2003-11-06 Jan Hubicka <jh@suse.cz>
  5036. * tree-cfg.c (cleanup_cond_expr_graph): Clean edge flags.
  5037. 2003-11-06 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  5038. * tree-dump.c (dump_options): Remove TDF_LINENO from all setting.
  5039. 2003-11-06 Jan Hubicka <jh@suse.cz>
  5040. * builtins.c (expand_builtin_strstr, expand_builtin_strchr,
  5041. expand_builtin_strrchr, expand_builtin_strpbrk,
  5042. simplify_builtin_strstr, simplify_builtin_strrchr,
  5043. simplify_builtin_strpbrk): Add missing casts.
  5044. 2003-11-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  5045. * diagnostic.h (print_generic_decl): Declare.
  5046. * tree-cfg.c (dump_cfg_function_to_file): Dump variables in
  5047. unexpanded_var_list.
  5048. * tree-pretty-print.c (print_generic_decl): New function.
  5049. 2003-11-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  5050. * Makefile.in (gimplify.o): Add function.h dependency.
  5051. * c-call-graph.c (construct_call_graph): Modify build_tree_cfg call.
  5052. * gimple-low.c (record_vars): Export.
  5053. (lower_function_body): Remove the topmost BIND_EXPR.
  5054. * gimplify.c: Include function.h.
  5055. (gimple_add_tmp_var): Record temporaries in the
  5056. cfun->unexpanded_vars_list if available.
  5057. * tree-cfg.c (build_tree_cfg): Work without the topmost BIND_EXPR.
  5058. (dump_cfg_function_to_file): New.
  5059. (dump_tree_cfg): Use dump_cfg_function_to_file.
  5060. * tree-dump.c (dump_function_to_file): Work without the topmost
  5061. BIND_EXPR.
  5062. * tree-flow.h (build_tree_cfg): Declaration changed.
  5063. (dump_cfg_function_to_file, record_vars): Declare.
  5064. * tree-optimize.c (optimize_function_tree, tree_rest_of_compilation):
  5065. Work without the topmost BIND_EXPR.
  5066. * tree-must-alias.c (tree_compute_must_alias): Use
  5067. dump_cfg_function_to_file.
  5068. * tree-ssa-ccp.c (tree_ssa_ccp): Ditto.
  5069. * tree-ssa-copyprop.c (tree_ssa_copyprop): Ditto.
  5070. * tree-ssa-dce.c (tree_ssa_dce): Ditto.
  5071. * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): Ditto.
  5072. * tree-ssa-pre.c (tree_perform_ssapre): Ditto.
  5073. * tree-ssa.c (rewrite_into_ssa, rewrite_out_of_ssa): Ditto.
  5074. * tree-tailcall.c (tree_optimize_tail_calls): Ditto.
  5075. * tree.h (optimize_function_tree): Declaration changed.
  5076. 2003-11-03 Daniel Berlin <dberlin@dberlin.org>
  5077. * tree-ssa-pre.c (handle_bb_creation): Removed.
  5078. (redo_dominators): Removed.
  5079. (insert_one_operand): Remove code to handle bb creation, since all
  5080. critical edges are now pre-split.
  5081. (finalize_2): Remove redo_dominators related code.
  5082. (pre_expression): Return 1 if we exited early because nothing happened.
  5083. (split_critical_edges): Do fake variable assignments instead, because
  5084. it works. return true if we actually split an edge.
  5085. (tree_perform_ssapre): Remove redo_dominators code.
  5086. 2003-11-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  5087. * function.h (struct function): New field unexpanded_var_list.
  5088. * gimple-low.c (unexpanded_var_list): Removed.
  5089. (record_vars, expand_used_vars): Use cfun->unexpanded_var_list.
  5090. * tree-flow.h (unexpanded_var_list): Declaration removed.
  5091. * gimplify.c (should_carry_locus_p): New.
  5092. (annotate_all_with_locus_1): Use it. Do not annotate empty
  5093. statements.
  5094. 2003-11-03 Jan Hubicka <jh@suse.cz>
  5095. * tree-cfg.c (tree_try_redirect_by_replacing_jump): Do not use
  5096. succesor_block.
  5097. 2003-11-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  5098. * tree-pretty-print.c (dump_block_info): Add flags parameter.
  5099. Only show line number when asked to.
  5100. (dump_generic_node): Pass flags to dump_block_info.
  5101. 2003-11-03 Jan Hubicka <jh@suse.cz>
  5102. * cfghooks.h (redirect_edge_and_branch hook): Make it return edge.
  5103. * cfgrtl.c (cfg_layout_redirect_edge_and_branch,
  5104. rtl_redirect_edge_and_branch, try_redirect_by_replacing_jump):
  5105. Update to new interface.
  5106. * tree-cfg.c (tree_cfg_hooks): Move to end of file; set
  5107. redirect_edge_and_branch and redirect_edge_and_branch_force.
  5108. (thread_jumps): Use redirect_edge_and_branch.
  5109. (tree_block_label): new; break out of thread_edge.
  5110. (tree_try_redirect_by_replacing_jump): New.
  5111. (thread_edge): Rename to tree_redirect_edge_and_branch; deal sanely
  5112. with unusual edges; preserve profile.
  5113. (tree_redirect_edge_and_branch_force): New.
  5114. * tree-flow.h (ssa_redirect_edge): Declare.
  5115. * tree-ssa.dom.c (tree_ssa_dominator_optimize): Use redirect_edge_and_branch.
  5116. * tree-ssa.c (ssa_redirect_edge): New.
  5117. 2003-11-03 Jeff Law <law@redhat.com>
  5118. * domwalk.h (struct dom_walk_data): New field "global_data".
  5119. * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): Initialize new
  5120. "global_data" field.
  5121. * tree-flow.h (enum need_phi_state): New enumeration.
  5122. (var_ann_d): Add bitfield for need_phi_state.
  5123. * tree-ssa.c (mark_def_sites_global_data): New structure to hold
  5124. global data for mark_def_sites dominator walk.
  5125. (mark_def_sites): Revamp to be called via the dominator walker.
  5126. (set_def_block): Update need_phi_state for the variable as needed.
  5127. (set_livein_block): Similarly.
  5128. (rewrite_into_ssa): Use dominator walker to call mark_def_sites.
  5129. Delay freeing dominance info. Kill "globals" bitmap.
  5130. (insert_phi_nodes): No longer need "globals" bitmap. Use
  5131. need_phi_state in variable's annotation to determine if a PHI
  5132. may be needed.
  5133. * tree-ssa-dom.c (dom_opt_finalize_block): Try to thread across the
  5134. edges leaving COND_EXPR nodes which are leafs in the dominator
  5135. tree.
  5136. (record_equivalences_from_incoming_edge): Do not set EQ_EXPR_VALUE
  5137. unless the block's single predecessor contains parent_block_last_stmt.
  5138. 2003-11-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  5139. * tree-dump.c (dump_options): Add TDF_LINENO.
  5140. * tree-pretty-print.c (dump_generic_node): Print line number for
  5141. statements if asked to.
  5142. * tree.h (TDF_LINENO): New.
  5143. * doc/invoke.texi (lineno): Document.
  5144. 2003-11-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  5145. * expr.c (expand_vars, expand_var): Split of ...
  5146. (expand_expr_1): ... here.
  5147. * expr.h (expand_var): Declare.
  5148. * gimple-low.c (lower_function_body, lower_stmt, lower_bind_expr):
  5149. Eliminate BIND_EXPRs.
  5150. (expand_used_vars): New.
  5151. * tree-alias-common.c (create_alias_vars): Walk variables in blocks.
  5152. * tree-cfg.c (make_bind_expr_blocks): Removed.
  5153. (make_blocks, build_tree_cfg, factor_computed_gotos): Don't handle
  5154. BIND_EXPRs.
  5155. (assign_vars_to_scope, successor_block, NEXT_BLOCK_LINK): Removed.
  5156. (make_edges, make_exit_edges): Don't use successor_block.
  5157. (remove_useless_stmts_and_vars_goto): Don't expect NEXT_BLOCK_LINK
  5158. to be set.
  5159. (bsi_init, bsi_next_in_bb, bsi_from_tsi): Don't handle BIND_EXPRs.
  5160. (replace_stmt): Don't create BIND_EXPRs.
  5161. * tree-flow.h (struct var_ann_d): Removed field scope.
  5162. (struct stmt_ann_d): Removed fields scope and scope_level.
  5163. (propagate_copy): Declaration changed.
  5164. (fixup_var_scope): Removed.
  5165. * tree-must-alias.c (tree_compute_must_alias): Consider DECL_NONLOCAL
  5166. vars call clobbered.
  5167. * tree-optimize.c (tree_rest_of_compilation): Call expand_used_vars.
  5168. * tree-ssa-copyprop.c (move_var_to_scope, fixup_var_scope): Removed.
  5169. (copyprop_stmt): Call to propagate_copy changed.
  5170. (propagate_copy): Don't update scope.
  5171. * tree-ssa-dom.c (cprop_into_stmt): Call to propagate_copy changed.
  5172. (eliminate_redundant_computations): Don't call fixup_var_scope.
  5173. * tree-ssa.c (insert_copy_on_edge): Don't update scope.
  5174. 2003-11-02 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  5175. * tree-inline.c (walk_tree): Tail recursion optimized for
  5176. COMPOUND_EXPRs.
  5177. * tree-eh.c (collect_finally_tree): Ditto.
  5178. 2003-11-02 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  5179. * tree-optimize.c (optimize_function_tree): Removed duplicate call of
  5180. lower_function_body. Moved call of reset_block_changes ...
  5181. (tree_rest_of_compilation) ... here. Reset the scope to top before
  5182. expanding function end.
  5183. 2003-11-01 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  5184. * basic-block.h (BB_CONTROL_STRUCTURE): Removed.
  5185. * tree-cfg.c (struct cfg_stats_d): Field num_merged_cases removed.
  5186. (make_blocks, make_bind_expr_blocks, append_stmt_to_bb, bsi_link_after,
  5187. build_tree_cfg, factor_computed_gotos, prepend_stmt_to_bb,
  5188. remove_stmt, replace_stmt): Don't set parent.
  5189. (set_parent_stmt, add_stmt_to_bb, find_contained_blocks,
  5190. blocks_unreachable_p, remove_blocks, remove_unreachable_block,
  5191. move_outgoing_edges, merge_tree_blocks, remap_stmts): Removed.
  5192. (REMOVE_ALL_STMTS, REMOVE_NO_STMTS, REMOVE_NON_CONTROL_STRUCTS,
  5193. REMOVE_CONTROL_STRUCTS): Removed.
  5194. (remove_bb): Code to handle control structures removed.
  5195. (tree_block_forwards_to): Don't stop due to CASE_LABEL_EXPRs.
  5196. (tree_dump_bb): Don't print parent. Print only BIND_EXPRs in slim
  5197. form.
  5198. (dump_tree_cfg): Don't count merged case labels.
  5199. (is_ctrl_structure): Removed.
  5200. (stmt_starts_bb_p): Don't handle CASE_LABEL_EXPRs.
  5201. (tree_verify_flow_info): Don't check BB_CONTROL_STRUCTURE.
  5202. * tree-flow-inline.h (parent_block, parent_stmt): Removed.
  5203. * tree-flow.h (struct stmt_ann_d): Remove parent_stmt field.
  5204. (parent_stmt, parent_block, is_ctrl_structure): Declarations removed.
  5205. * tree-pretty-print.c (dump_generic_node): Don't handle lowered
  5206. COND_EXPRs specially.
  5207. * tree-ssa-ccp.c (visit_stmt): Don't check is_ctrl_structure.
  5208. 2003-10-31 Jeff Law <law@redhat.com>
  5209. * tree-ssa-dom.c (record_equivalences_from_stmt): Restore lost code
  5210. to create equivalences from BIT_IOR_EXPR.
  5211. * tree-ssa-dom.c (thread_jumps_walk_stmts): Go ahead and optimize
  5212. a COND_EXPR with a compile-time constant condition.
  5213. 2003-10-31 Diego Novillo <dnovillo@redhat.com>
  5214. * tree-optimize.c (optimize_function_tree): Fix comment
  5215. describing SSA pass after DOM2.
  5216. 2003-10-31 Diego Novillo <dnovillo@redhat.com>
  5217. Fix PR optimization/12825
  5218. * tree-optimize.c (optimize_function_tree): Run SSA renamer after
  5219. second DOM pass.
  5220. 2003-10-30 Richard Henderson <rth@redhat.com>
  5221. * c-common.c (match_case_to_enum_1, match_case_to_enum): New.
  5222. (c_do_switch_warnings): New.
  5223. * c-common.h (c_do_switch_warnings): Declare.
  5224. * c-typeck.c (c_finish_case): Call it.
  5225. * stmt.c (all_cases_count, BITARRAY_TEST, BITARRAY_SET,
  5226. mark_seen_cases, check_for_full_enumeration_handling): Remove.
  5227. (expand_end_case_type): Don't do warn_switch handling.
  5228. * expr.h, tree.h: Remove dead decls.
  5229. * c-simplify.c (gimplify_switch_stmt): Force switch body non-null.
  5230. 2003-10-30 Richard Henderson <rth@redhat.com>
  5231. * tree-cfg.c (thread_jumps): Allow SWITCH_EXPR.
  5232. (thread_edge): Handle it. Tidy surrounding code.
  5233. 2003-10-30 Richard Henderson <rth@redhat.com>
  5234. * domwalk.c (walk_dominator_tree): Pass any final is_ctrl_stmt
  5235. down the recursive walk.
  5236. 2003-10-30 Jeff Law <law@redhat.com>
  5237. * tree-ssa-dom.c (thread_across_edge): Renamed from
  5238. thread_through_successor. Revamp to thread the destination of an edge
  5239. rather than the successors of a block.
  5240. (dom_opt_finalize_block): Corresponding changes. Do not bother calling
  5241. thread_across_edge unless we are at a leaf in the dominator tree.
  5242. * tree-cfg.c (thread_jumps): Now returns a bool. Move some tests into
  5243. tree_forwarder_block_p. Improve comments.
  5244. (cleanup_control_flow): Now returns a bool indicating if anything was
  5245. changed.
  5246. (thread_unconditional_jumps): Kill.
  5247. (cleanup_tree_cfg): Repeat cascading cleanups until nothing changes.
  5248. (tree_forwarder_block_p): Check forwardable bit in the block's
  5249. annotation to avoid useless work. Mark blocks as not forwardable as
  5250. appropriate. Verify destination is not the exit block here. Do not
  5251. consider successors of the entry block as forwarders. Ignore empty
  5252. statements when walking through the block's statements. Verify target
  5253. block is not the start of a case label and that we can safely insert
  5254. a label at the target block.
  5255. 2003-10-29 Richard Henderson <rth@redhat.com>
  5256. * c-common.c (c_warn_unused_result): Remove lowered containers.
  5257. * c-semantics.c (genrtl_case_label): Update add_case_node call.
  5258. * c-simplify.c (gimplify_switch_stmt): Build SWITCH_EXPR and
  5259. gimplify it simultaneously with the body.
  5260. * expr.c (expand_expr_1): Handle SWITCH_BODY clear and
  5261. SWITCH_LABELS set. Update add_case_node calls.
  5262. * gimple-low.c (lower_stmt): Don't do anything for SWITCH_EXPR.
  5263. (lower_switch_expr, lower_case_label_expr): Remove.
  5264. * gimplify.c (gimplify_switch_expr): Zap SWITCH_BODY after
  5265. gimplification. Force default entry for SWITCH_LABELS.
  5266. (gimplify_case_label_expr): Rename from gimple_add_case_label.
  5267. Assert switch in scope; lower to LABEL_EXPR.
  5268. * stmt.c (pushcase, pushcase_range) Update add_case_node calls.
  5269. (add_case_node): Add dont_expand_label argument.
  5270. (same_case_target_p): Don't search rtl.
  5271. * tree-cfg.c (enum find_location_action): Remove.
  5272. (make_switch_expr_blocks): Remove.
  5273. (make_blocks): Update.
  5274. (make_case_label_edges): Remove.
  5275. (make_edges): Update.
  5276. (find_contained_blocks): Remove lowered containers.
  5277. (make_switch_expr_edges): New.
  5278. (make_ctrl_stmt_edges): Call it.
  5279. (make_cond_expr_edges): Use label_to_block.
  5280. (remove_useless_stmts_and_vars_1): Don't go into SWITCH_BODY.
  5281. (remove_unreachable_block): Remove SWITCH_EXPR special case.
  5282. (cleanup_cond_expr_graph): Tidy.
  5283. (cleanup_switch_expr_graph): Rewrite.
  5284. (disconnect_unreachable_case_labels): Remove.
  5285. (find_taken_edge_cond_expr): Use integer_zerop/integer_nonzerop.
  5286. (find_taken_edge_switch_expr): Rewrite.
  5287. (value_matches_some_label): Remove.
  5288. (find_case_label_for_value): New.
  5289. (is_ctrl_structure): Remove lowered containers.
  5290. (is_ctrl_stmt): Add SWITCH_EXPR.
  5291. (switch_parent): Remove.
  5292. (handle_switch_fallthru): Remove.
  5293. (handle_switch_split): Remove.
  5294. (find_insert_location): Merge into ...
  5295. (bsi_insert_on_edge_immediate): ... here. Simplify.
  5296. (tree_split_edge): Don't set EDGE_FALLTHRU.
  5297. * tree-eh.c (collect_finally_tree): Remove lowered containers.
  5298. (replace_goto_queue_1, block_may_fallthru_last): Likewise.
  5299. (lower_eh_constructs_1): Likewise.
  5300. (verify_norecord_switch_expr): New.
  5301. (lower_try_finally_switch): Generate lowered switches.
  5302. * tree-inline.c (expand_calls_inline): Don't search null SWITCH_BODY.
  5303. * tree-pretty-print.c (dump_generic_node): Do something sensible
  5304. with lowered switch_expr.
  5305. * tree-ssa-dom.c (record_equivalences_from_incoming_edge): Update
  5306. for lowered switch_expr.
  5307. * tree.def (SWITCH_EXPR): Update docs.
  5308. * tree.h (add_case_node): Update decl.
  5309. 2003-10-29 Daniel Berlin <dberlin@dberlin.org>
  5310. * tree-ssa-pre.c (n_phi_preds): New variable.
  5311. (generate_vops_as_of_bb): New function
  5312. (generate_expr_as_of_bb): Remove unused first argument. Update all
  5313. callers.
  5314. (subst_phis): Add boundary check for the phi_pred_cache array.
  5315. (same_e_version_phi_result): Once modified, no point in continuing
  5316. the loop.
  5317. (finalize_2): ESSA Minimization can crash if we ended up with new
  5318. BB's
  5319. 2003-10-29 Richard Henderson <rth@redhat.com>
  5320. * tree-eh.c (do_return_redirection): Don't move copy to RESULT_DECL
  5321. outside the RETURN_EXPR. Introduce a new temporary as needed.
  5322. 2003-10-26 Richard Henderson <rth@redhat.com>
  5323. * gimplify.c (keep_function_tree_in_gimple_form): Remove.
  5324. (gimplify_function_tree): Return void. Remove hack for
  5325. language not supporting gimple.
  5326. * tree.h: Update decls.
  5327. * langhooks-def.h (LANG_HOOKS_GIMPLE_BEFORE_INLINING): New.
  5328. * langhooks.h (struct lang_hooks): Add gimple_before_inlining.
  5329. * tree-inline.c (copy_body_r): Check that instead of
  5330. keep_function_tree_in_gimple_form.
  5331. (initialize_inlined_parameters): Likewise.
  5332. (expand_call_inline, expand_calls_inline): Likewise.
  5333. * explow.c (probe_stack_range): Never emit loop notes.
  5334. * expr.c (emit_block_move_via_loop): Likewise.
  5335. * toplev.c (rest_of_compilation): Always synthesize loop notes.
  5336. 2003-10-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  5337. * Makefile.in (gimple-low.o): Add function.h dependency.
  5338. * gimple-low.c (struct lower_data): New field block.
  5339. (lower_function_body, lower_stmt, lower_bind_expr): Record
  5340. the block at statements.
  5341. * cfglayout.c (insn_locators_initialize): Use new info about
  5342. blocks.
  5343. * expr.c (expand_expr): Record block changes.
  5344. * function.c (blocks_nreverse): Export.
  5345. (uninitialized_vars_warning): Use DECL_RTL_SET_P to test for presence
  5346. of rtl.
  5347. (reset_block_changes, record_block_change, finalize_block_changes,
  5348. check_block_change, free_block_changes): New functions.
  5349. * function.h (struct function): New bitfield dont_emit_block_notes.
  5350. New field ib_boundaries_block.
  5351. (blocks_nreverse, reset_block_changes, record_block_change,
  5352. finalize_block_changes, check_block_change, free_block_changes):
  5353. Declare.
  5354. * sibcall.c (optimize_sibling_and_tail_recursive_call): Don't call
  5355. reorder_blocks when dont_emit_block_notes.
  5356. * stmt.c (expand_start_bindings_and_block, expand_end_bindings):
  5357. Don't emit block notes when dont_emit_block_notes.
  5358. * toplev.c (rest_of_compilation): Don't call reorder_blocks when
  5359. dont_emit_block_notes.
  5360. * tree.c (build1): Initialize TREE_BLOCK field.
  5361. * tree-flow.h (lower_function_body): Declare.
  5362. * tree-optimize.c: Include function.h.
  5363. (optimize_function_tree): Call lower_function_body.
  5364. * tree.h (struct tree_exp): Add block field.
  5365. (TREE_BLOCK): New macro.
  5366. 2003-10-26 Richard Henderson <rth@redhat.com>
  5367. * tree.h (tree_dump_index): Add TDI_lower.
  5368. * tree-dump.c (dump_files): Add .lower entry.
  5369. * tree-optimize.c (optimize_function_tree): Move lower_function_body,
  5370. (tree_rest_of_compilation): here. Tidy .useless dump.
  5371. 2003-10-25 Jan Hubicka <jh@suse.cz>
  5372. * c-common.c (c_estimate_num_insns_1): Kill.
  5373. (c_estimate_num_insns): Kill.
  5374. * c-common.h (c_estimate_num_insns): Kill.
  5375. * c-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill.
  5376. * cp-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill.
  5377. * objc-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill.
  5378. * java/lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill.
  5379. (java_estimate_num_insns_1, java_estimate_num_insns): Kill.
  5380. * cgraphunit (cgraph_analyze_function): Use estimate_num_insns.
  5381. * tree-eh.c (decide_copy_try_finally): Likewise.
  5382. * tree-inline.c (limits_allow_inilining, optimize_inline_calls): Likewise.
  5383. (estimate_num_insns_1, estimate_num_insns): New functions.
  5384. * langhooks-def.h (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill.
  5385. * langhooks.h (estimate_num_inssn): Kill.
  5386. * tree-inline.h (estimate_num_insns): Declare.
  5387. 2003-10-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  5388. * gimple-low.c: New.
  5389. * Makefile.in (gimple-low.o): Add.
  5390. * domwalk.c (walk_dominator_tree): Consider COND_EXPR a control
  5391. structure.
  5392. * tree-cfg.c (make_cond_expr_blocks, linearize_control_structures,
  5393. linearize_cond_expr): Removed.
  5394. (thread_jumps, tree_forwarder_block_p): New.
  5395. (merge_tree_blocks): Unused now.
  5396. (phi_alternatives_equal): Modified for use in jump threading.
  5397. (enum find_location_action): Remove EDGE_INSERT_LOCATION_NEW_ELSE.
  5398. (make_blocks): Don't call make_cond_expr_blocks.
  5399. (set_parent_stmt): Ensure we don't set COND_EXPR as a parent
  5400. statement.
  5401. (find_contained_blocks): Remove COND_EXPR alternative.
  5402. (make_cond_expr_edges): Handle lowered gotos.
  5403. (cleanup_tree_cfg): Don't call linearize_control_structures,
  5404. call thread_jumps and verify_flow_info and rerun cleanup_control_flow.
  5405. (remove_unreachable_block): Remove handling of structured COND_EXPRs.
  5406. (remove_bb): Fix warning for removed goto exprs.
  5407. (cleanup_control_flow, cleanup_cond_expr_graph,
  5408. cleanup_switch_expr_graph, find_taken_edge_cond_expr,
  5409. bsi_insert_before, find_insert_location, bsi_insert_on_edge_immediate):
  5410. Handle lowered COND_EXPRs.
  5411. (is_ctrl_structure): Remove COND_EXPR.
  5412. (is_ctrl_stmt): Add COND_EXPR.
  5413. (tree_verify_flow_info): Check validity of COND_EXPRs.
  5414. (thread_edge): Moved from tree-ssa-dom.c.
  5415. * tree-flow.h (cleanup_cond_expr_graph, cleanup_switch_expr_graph):
  5416. Declaration changed.
  5417. (thread_edge, lower_function_body): Declare.
  5418. * tree-optimize.c (optimize_function_tree): Call lower_function_body.
  5419. * tree-pretty-print.c (dump_generic_node): Dump lowered cond_exprs in
  5420. full.
  5421. * tree-ssa-copyprop.c (fixup_var_scope): Handle non-SSA_NAMEs.
  5422. * tree-ssa-dce.c (stmt_useful_p, process_worklist): Cleaned up when
  5423. COND_EXPRs are lowered.
  5424. * tree-ssa-dom.c (thread_edge): Moved to tree-cfg.c.
  5425. (tree_ssa_dominator_optimize_1): Dumps and setting of vars_to_rename
  5426. moved from thread_edge.
  5427. (optimize_stmt): Pass block iterator to cleanup_cond_expr_graph and
  5428. cleanup_switch_expr_graph.
  5429. * tree-ssa.c (insert_copy_on_edge): Fixup scope for emitted variables.
  5430. * dominance.c (BB_NODE): Use VARRAY_GENERIC_PTR_NOGC.
  5431. (calculate_dominance_info): Use VARRAY_GENERIC_PTR_NOGC_INIT.
  5432. * varray.c (element): Add GENERIC_PTR_NOGC entry.
  5433. * varray.h (enum varray_data_enum): Add VARRAY_DATA_GENERIC_NOGC.
  5434. (union varray_data_tag): Add generic_nogc.
  5435. (VARRAY_GENERIC_PTR_NOGC_INIT, VARRAY_GENERIC_PTR_NOGC,
  5436. VARRAY_PUSH_GENERIC_PTR_NOGC, VARRAY_TOP_GENERIC_PTR_NOGC): New.
  5437. 2003-10-25 Jan Hubicka <jh@suse.cz>
  5438. * cppcharset.c (one_utf8_to_utf32): Initialize 's' to silence warning.
  5439. 2003-10-25 Jan Hubicka <jh@suse.cz>
  5440. * fold-const.c (nondestructive_fold_binary_to_constant): Realize that
  5441. (plus (address) (const_int)) is a constant.
  5442. 2003-10-25 Jan Hubicka <jh@suse.cz>
  5443. * opts.c (decode_options): Uncomment unit-at-a-time setting
  5444. * params.def: Syncrhonize with manline.
  5445. * tree-inline.c (initialize_inlined_parameters): Set variable as
  5446. gimplified.
  5447. 2003-10-24 Steven Bosscher <steven@gcc.gnu.org>
  5448. * gimplify.c (create_artificial_label): New function.
  5449. (build_and_jump): Use it.
  5450. * c-simplify.c (c_gimplify_stmt): Likewise.
  5451. (gimplify_condition): Likewise.
  5452. * tree-cfg.c (factor_computed_gotos, tree_block_forwards_to,
  5453. handle_switch_fallthru, handle_switch_split): Likewise.
  5454. * tree-ssa-dom.c (thread_edge): Likewise.
  5455. * tree-ssa-pre.c (split_critical_edges): Likewise.
  5456. * tree-tailcall.c (eliminate_tail_call): Likewise.
  5457. * tree-eh.c (frob_into_branch_around,
  5458. honor_protect_cleanup_actions, lower_try_finally_nofallthru,
  5459. lower_try_finally_onedest, lower_try_finally_copy,
  5460. lower_try_finally_switch, lower_catch, lower_eh_filter,
  5461. lower_cleanup): Likewise.
  5462. (make_label): Remove.
  5463. * tree-simple.h (create_artificial_label): Add prototype.
  5464. * tree-inline.c (expand_call_inline): Make return label for
  5465. inlined function artificial.
  5466. 2003-10-23 Jeff Law <law@redhat.com>
  5467. * timevar.def (TV_TREE_SSA_THREAD_JUMPS): New timevar.
  5468. * tree-dump.c (dump_files): Add dump file for jump threading.
  5469. * tree.h (TDI_thread_jumps): New enum member.
  5470. * tree-cfg.c (tree_block_forwards_to): No longer static.
  5471. * tree-flow.h (tree_block_forwards_to): Prototype.
  5472. (tree_ssa_dominator_thread_jumps): Likewise.
  5473. * tree-optimize.c (optimize_function_tree): Call jump threader.
  5474. * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): New function.
  5475. Common code for redundancy elimination and jump threading on
  5476. the dominator tree. Slightly different callback initialization
  5477. for redundancy elimination and jump threading. Initialize
  5478. block forwardable attribute.
  5479. (tree_ssa_dominator_optimize): Call tree_ssa_dominator_optimize_1.
  5480. (tree_ssa_dominator_thread_jumps): New function.
  5481. (thread_edge): Mark results of PHI nodes as needing rewriting if
  5482. we have threaded through a block with PHI nodes.
  5483. (thread_through_successor): If thread_through_phis is nonzero,
  5484. then allow jump threading through blocks with PHI nodes. If the
  5485. target block is a forwarder block, then forward the jump.
  5486. (thread_jumps_walk_stmts): Statement walker for dominator thread
  5487. jumping.
  5488. * tree-ssa-dom.c (record_equivalence_from_incoming_edge): Fix
  5489. comment typo.
  5490. 2003-10-23 Richard Henderson <rth@redhat.com>
  5491. * gimplify.c (gimplify_*): Return gimplify_status.
  5492. (gimple_add_tmp_var): Set seen_in_bind_expr.
  5493. (gimplify_bind_expr): Likewise. Kill if 0 code.
  5494. (gimplify_return_expr): Cope with error marks.
  5495. (gimple_push_cleanup): Do nothing if errors seen.
  5496. (gimplify_expr): Cope with error marks. Use gimplify_status to
  5497. decide when to exit the main loop. Zap statements with errors.
  5498. (gimplify_body): Return void.
  5499. (keep_function_tree_in_gimple_form): Don't exit on errors.
  5500. (gimplify_function_tree): Return bool. Don't exit on errors.
  5501. * langhooks.c (lhd_gimplify_expr): Return GS_UNHANDLED.
  5502. * langhooks.h (struct lang_hooks): Update docs for gimplify_expr.
  5503. * tree-optimize.c (optimize_function_tree): Don't exit on errors.
  5504. Move delete_tree_cfg call outside optimization clause.
  5505. (tree_rest_of_compilation): Don't exit on errors.
  5506. * tree-simple.h (enum gimplify_status): New.
  5507. (gimplify_expr, gimplify_stmt, gimplify_body): Update.
  5508. * tree-ssa.c (rewrite_out_of_ssa): Move delete_tree_cfg call to
  5509. optimize_function_tree.
  5510. * tree.h (struct tree_decl): Add seen_in_bind_expr.
  5511. (gimplify_function_tree): Update.
  5512. * c-common.c (c_add_case_label): Unify three error exit paths.
  5513. Create a normal label, not a case label to suppress unreachable
  5514. code warning.
  5515. * c-simplify.c (c_build_bind_expr): Don't create an empty bind
  5516. body. Pass entire bind_expr to gimplify_stmt.
  5517. (gimplify_block): Don't abort on mismatches if errors seen.
  5518. (gimplify_expr_stmt): Cope with error marks.
  5519. (gimplify_decl_stmt): Likewise.
  5520. (c_gimplify_expr): Return gimplify_status.
  5521. 2003-10-22 Daniel Berlin <dberlin@dberlin.org>
  5522. * tree-pretty-print.c (dump_generic_node): Kill off ELEFT_NODE.
  5523. Print out status of new EUSE_LVAL flag.
  5524. * tree-ssa-pre.c: #include alloc-pool.h
  5525. (append_eref_to_block): Inline.
  5526. (names_match_p): Ditto.
  5527. (pre_expression): Take sbitmap of variables to rename so we can
  5528. mark our new variable if necessary.
  5529. (insert_occ_in_preorder): Completely redo to be an O(n log n)
  5530. algorithm worst case, instead O(n^2) all the time.
  5531. (build_dfn_array): New function.
  5532. (eref_compare): Ditto.
  5533. (preorder_count): Remove no-longer used variable.
  5534. (pre_stats): Add new stats about memory use.
  5535. (struct expr_info): add loadpre_cand member.
  5536. (euse_node_pool): New alloc-pool
  5537. (eref_node_pool): Ditto
  5538. (create_expr_ref): Use them.
  5539. (expr_phi_insertion): Insert on PHI's of VUSES for loadpre cands.
  5540. Not all expressions have uses (left occurrences don't).
  5541. (load_modified_real_occ_real_occ): Return false, not abort.
  5542. (process_delayed_rename): Remove useless fibheap, do proper LVAL
  5543. handling.
  5544. (insert_euse_in_preorder_dt_order_1): No more ELEFT_NODE's.
  5545. (finalize_1): Ditto.
  5546. (set_save): Ditto.
  5547. (really_available_def): New function.
  5548. (finalize_2): Use really_available_def, not EUSE_SAVE, during EPHI
  5549. minimization.
  5550. (names_match_p): Handle INDIRECT_REF properly.
  5551. (call_modifies_slot): Removed.
  5552. (add_call_to_ei): Removed.
  5553. (process_left_occs_and_kills): Fix.
  5554. (pre_expression): Zero out counts.
  5555. (collect_expressions): Split out from tree_perform_ssapre. Do this
  5556. in domtree order.
  5557. (tree_perform_ssapre): Create and free alloc-pools.
  5558. Rename new variables that need to be renamed.
  5559. * tree.c (tree_size): Remove ELEFT_NODE.
  5560. (tree_node_size): Ditto.
  5561. (is_essa_node): Ditto.
  5562. * tree.def (ELEFT_NODE): Gone.
  5563. * tree.h (EREF_NODE_CHECK): No more ELEFT_NODE.
  5564. (struct tree_eref_common): Add ID flag.
  5565. (struct tree_euse_node): Add lval flag.
  5566. (EREF_ID): New macro.
  5567. (EUSE_LVAL): New macro.
  5568. 2003-10-22 Daniel Berlin <dberlin@dberlin.org>
  5569. * tree-flow-inline.h (add_dom_child): XMALLOC, not GGC_ALLOC,
  5570. the bitmap.
  5571. (clear_dom_children): XFREE the bitmap.
  5572. 2003-10-22 Andrew MacLeod <amacleod@redhat.com>
  5573. * tree-ssa-live.c (new_tree_live_info, (delete_tree_live_info,
  5574. live_worklist, set_if_valid, add_livein_if_notdef,
  5575. calculate_live_on_entry, calculate_live_on_exit,
  5576. add_conflicts_if_valid, dump_live_info): Use bitmap instead of sbitmap.
  5577. (build_tree_conflict_graph): Use bitmap, Change mechanism for
  5578. adding conflicts between live-on-entry partitions.
  5579. * tree-ssa-live.h (struct tree_live_info_d): Switch to bitmaps.
  5580. (partition_is_global, live_entry_blocks, live_on_exit,
  5581. live_merge_and_clear, make_live_on_entry): Switch to bitmaps.
  5582. * tree-ssa.c (struct _elim_graph): Remove bitmaps, use varrays.
  5583. (new_elim_graph, clear_elim_graph, delete_elim_graph): Switch from
  5584. old bitmap implementation.
  5585. (elim_graph_size): New. Number of elements in elimination graph.
  5586. (elim_graph_add_node): New. Add an element to the elim-graph.
  5587. (elim_graph_add_edge): New. Add an edge to the elim-graph.
  5588. (elim_graph_remove_succ_edge): New. Remove an edge for which a node
  5589. has a successor.
  5590. (FOR_EACH_ELIM_GRAPH_SUCC): Find all successor nodes.
  5591. (FOR_EACH_ELIM_GRAPH_PRED): Find all predeccesor nodes.
  5592. (eliminate_name, eliminate_build, elim_forward,
  5593. elim_unvisited_predecessor, elim_backward, elim_create, eliminate_phi):
  5594. Use new elim-graph routines.
  5595. (rewrite_out_of_ssa): Enable single-definition compaction when not
  5596. combining temporaries.
  5597. 2003-10-21 Richard Henderson <rth@redhat.com>
  5598. * gimplify.c: Sort functions into use order, and all gimplification
  5599. functions to the end.
  5600. 2003-10-22 Jeff Law <law@redhat.com>
  5601. * tree-cfg.c (thread_unconditional_jumps): New function.
  5602. (tree_block_forwards_to): Likewise.
  5603. (cleanup_tree_cfg): Call thread_unconditional_jumps.
  5604. * tree-flow.h (bb_ann_t): Add forwardable status bit.
  5605. * tree-dump.c (dump_files): Add entry for TDI_none.
  5606. (dump_begin): Do nothing for TDI_none.
  5607. (dump_enable_all, dump_switch_p): Start our scan at TDI_none + 1.
  5608. * tree.h (tree_dump_index): Add.
  5609. * tree-ssa-dom.c (tree_ssa_dominator_optimize): If we have altered the
  5610. CFG and we have variables to [re]rename, go ahead and rename them before
  5611. starting the next iteration of the dominator optimizer.
  5612. 2003-10-21 Jason Merrill <jason@redhat.com>
  5613. * gimplify.c (gimplify_modify_expr): Require a regvar on either
  5614. the lhs or rhs if we're dealing with a renameable type.
  5615. (canonicalize_component_ref): New fn.
  5616. (gimplify_compound_lval): Use it.
  5617. (gimplify_conversion): Use it.
  5618. (gimplify_expr): Lose redundant STRIP_MAIN_TYPE_NOPS.
  5619. Discard conversions in void context.
  5620. 2003-10-21 Daniel Berlin <dberlin@dberlin.org>
  5621. * tree-ssa-pre.c (pre_expression): Free and allocate the
  5622. ephi_pindex_htab and phi_pred_cache in this function only.
  5623. (phi_pred_cache): New array to store cached phi preds, to avoid
  5624. recomputation and unnecessary copying.
  5625. (subst_phis): Use it.
  5626. (added_phis): array of added phis that is marked for GC.
  5627. * Makefile.in: Add tree-ssa-pre.c to the gtype files, and
  5628. gt-tree-ssa-pre.h to the list of generated files.
  5629. 2003-10-21 Jason Merrill <jason@redhat.com>
  5630. PR optimization/12661
  5631. * tree-dfa.c (get_expr_operands): Handle TRUTH_NOT_EXPR.
  5632. * tree-simple.c (is_gimple_rhs): Allow TRUTH_NOT_EXPR.
  5633. * gimplify.c (gimplify_expr) <TRUTH_NOT_EXPR>: Don't rewrite to an
  5634. EQ_EXPR.
  5635. 2003-10-21 Jan Hubicka <jh@suse.cz>
  5636. * haifa-sched.c (choose_ready): Initialize index.
  5637. * tree-tailcall.c (bb_optimize_tail_calls): Initialize has_return.
  5638. * f/lex.c (ffelex_cfelex_): Initialize d.
  5639. 2003-10-20 Diego Novillo <dnovillo@redhat.com>
  5640. Fix PR optimization/12688
  5641. * tree-dfa.c (get_stmt_operands): Don't return early when dealing
  5642. with an empty statement.
  5643. * tree-ssa-ccp.c (set_rhs): If the expression has no side effects,
  5644. replace the statement with an empty statement.
  5645. 2003-10-20 Andrew MacLeod <amacleod@redhat.com>
  5646. * tree-ssa-dce.c (processed): Change to an sbitmap.
  5647. (mark_necessary): Test bits in 'processed'.
  5648. (tree_ssa_dce): Initialize/free processed as an sbitmap.
  5649. 2003-10-20 Diego Novillo <dnovillo@redhat.com>
  5650. * tree-cfg.c (bsi_prev): Also copy the context from the previous
  5651. iterator.
  5652. 2003-10-18 Richard Henderson <rth@redhat.com>
  5653. * builtins.c (simplify_builtin): Handle BUILT_IN_CONSTANT_P.
  5654. 2003-10-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  5655. * tree-tailcall.c: New.
  5656. * Makefile.in (tree-tailcall.o): Add.
  5657. * function.c (assign_parms): Setting of current_function_stdarg
  5658. moved ...
  5659. (allocate_struct_function): ... here.
  5660. * tree-dump.c (dump_files): Add .tail dump.
  5661. * tree-flow.h (tree_optimize_tail_calls): Declare.
  5662. * tree-optimize.c (optimize_function_tree): Call
  5663. tree_optimize_tail_calls.
  5664. * tree.h (enum tree_dump_index): Add TDI_tail.
  5665. 2003-10-18 Jan Hubicka <jh@suse.cz>
  5666. * tree-ssa-copyprop.c (move_var_to_scope): Do not clear abstract
  5667. origin for static variables.
  5668. 2003-10-18 Jan Hubicka <jh@suse.cz>
  5669. * integrate.c (copy_decl_for_inlinig): Fix copying of copies.
  5670. 2003-10-18 Jan Hubicka <jh@suse.cz>
  5671. * cgraphunit.c (cgraph_analyze_function): Fix call of estimate_num_insns.
  5672. 2003-10-17 Kazu Hirata <kazu@cs.umass.edu>
  5673. * ChangeLog.tree-ssa: Fix typos.
  5674. * tree-alias-common.c: Fix comment typos.
  5675. * tree-cfg.c: Likewise.
  5676. * tree-dfa.c: Likewise.
  5677. * tree-eh.c: Likewise.
  5678. * tree-flow.h: Likewise.
  5679. * tree-iterator.h: Likewise.
  5680. * tree-mudflap.c: Likewise.
  5681. * tree-ssa-ccp.c: Likewise.
  5682. * tree-ssa-dce.c: Likewise.
  5683. * tree-ssa-dom.c: Likewise.
  5684. * tree-ssa-live.c: Likewise.
  5685. * tree-ssa-live.h: Likewise.
  5686. * tree-ssa-pre.c: Likewise.
  5687. * tree-ssa.c: Likewise.
  5688. 2003-10-17 Andrew MacLeod <amacleod@redhat.com>
  5689. * tree-ssa-dce.c (processed): New Global vector.
  5690. (mark_necessary): Check if SSA_NAME has already been processed first.
  5691. (find_useful_stmts, process_worklist): Change call to mark_necessary().
  5692. (tree_ssa_dce): Initialize and free processed vector.
  5693. * tree-cfg.c (handle_switch_fallthru): A new basic block can result
  5694. from splitting edges of nested switch stmts.
  5695. (handle_switch_split): If a new block is created, restart the loop for
  5696. inserting GOTO's to handle the new block.
  5697. 2003-10-17 Jan Hubicka <jh@suse.cz>
  5698. * tree-cfg.c (remove_useless_stmts_and_vars_bind): Fix handling of
  5699. static variables.
  5700. 2003-10-16 Richard Henderson <rth@redhat.com>
  5701. * common.opt (fdisable-gimple): Remove.
  5702. * flags.h (flag_disable_gimple): Remove.
  5703. * toplev.c (flag_disable_gimple): Remove.
  5704. (process_options): Don't check it.
  5705. (lang_independent_options): Don't set it.
  5706. * opts.c (common_handle_option): Likewise.
  5707. * gimplify.c (keep_function_tree_in_gimple_form): Don't check it.
  5708. * c-semantics.c (expand_stmt_toplev): Likewise.
  5709. * tree-optimize.c (tree_rest_of_compilation): Likewise.
  5710. * doc/invoke.texi: Don't document it.
  5711. 2003-10-16 Roger Sayle <roger@eyesopen.com>
  5712. * fold-const.c: Merge from mainline.
  5713. * tree.c (associate_tree_code, commutative_tree_code): Use a
  5714. switch statement instead of a sequence of comparisons.
  5715. 2003-10-16 Richard Henderson <rth@redhat.com>
  5716. * gimplify.c (maybe_protect_cleanup): Remove.
  5717. * tree-simple.h (maybe_protect_cleanup): Remove.
  5718. * c-simplify.c (gimplify_cleanup): Don't call it.
  5719. 2003-10-16 Jeff Law <law@redhat.com>
  5720. * tree-cfg.c (found_computed_goto): New global for computed goto
  5721. factoring/unfactoring.
  5722. (factored_computed_goto_label, factored_computed_goto): Likewise.
  5723. (factor_computed_gotos): New function.
  5724. (build_tree_cfg): Use it.
  5725. (make_blocks): Record whether or not we find a computed goto.
  5726. (remove_useless_stmts_and_vars): Un-factor computed gotos.
  5727. (remove_useless_stmts_and_vars): Reset factored_computed_goto_label
  5728. and factored_computed_goto.
  5729. * tree-ssa-dom.c (get_value_for, set_value_for): Move to the start
  5730. of the file. Delete pointless sanity checking.
  5731. * tree-ssa.c (currdefs): Now a varray instead of a hash table.
  5732. (get_value_for, set_value_for): Corresponding changes. Move to
  5733. the start of the file and delete pointless sanity checking.
  5734. (rewrite_into_ssa, dump_tree_ssa_stats): Corresponding changes.
  5735. (var_value_hash, var_value_eq): Kill.
  5736. * tree-ssa.c (rewrite_add_phi_arguments): Once we encounter a
  5737. rewritten PHI break the inner loop.
  5738. * tree-ssa.c (insert_phi_nodes_for): Use EXECUTE_IF_AND_COMPL_IN_BITMAP.
  5739. * tree-dfa.c (create_phi_node): Clear PHI_REWRITTEN on all new PHIs
  5740. (remove_all_phi_nodes_for): Set PHI_REWRITTEN on any PHIs which are
  5741. not removed.
  5742. * tree-ssa.c (rewrite_add_phi_arguments): Check the PHI node itself
  5743. to see if it has already been rewritten.
  5744. * tree.h (PHI_REWRITTEN): New accessor macro.
  5745. (struct phi_node): New field rewritten.
  5746. * tree-flow.h (struct bb_ann_d): New field num_preds.
  5747. * tree-dfa.c (create_phi_node): Get the number of predecessors from
  5748. the block's annotation.
  5749. * tree-ssa.c (rewrite_into_ssa): Compute number of preds for each
  5750. block and store it into the block's annotation.
  5751. (insert_phi_nodes_for): Get the number of preds for each block
  5752. from the block's annotation.
  5753. * tree-ssa.c: Remove parallel lifetime analysis code from April 2003.
  5754. (def_blocks_d): Remove PHI_INSERTION_POINTS field.
  5755. (compute_global_livein): Accept livein/def bitmaps to use for
  5756. life analyis rather than a varray of variables. Callers updated.
  5757. Rewritten to compute life information for one variable at a
  5758. time instead of several variables at once.
  5759. (insert_phis_for_deferred_variables): Remove.
  5760. (insert_phi_nodes_for): Lose varray argument. Callers updated.
  5761. No longer mess with deferring PHI insertions for variables.
  5762. (insert_phi_nodes): No longer need to deal with deferred variables.
  5763. Kill everything related to them.
  5764. 2003-10-15 Jeff Law <law@redhat.com>
  5765. * domwalk.c, domwalk.h: New files.
  5766. * Makefile.in (OBJS-common): Add domwalk.c.
  5767. (tree-ssa-dom.o): Add dependency on $(BASIC_BLOCK_H) and domwalk.h.
  5768. (tree-ssa.o): Add dependency on domwalk.h.
  5769. (domwalk.o): Add dependencies.
  5770. * tree-ssa-dom.c: Include domwalk.h.
  5771. (cfg_altered, vars_to_rename): Now globals.
  5772. (dom_walk_block_data): New structure for block data used by dominator
  5773. walker.
  5774. (optimize_block, record_equivalences_from_block_entry): Kill.
  5775. (optimize_stmt): Lose "cfg_altered" argument. Update callers.
  5776. Initialize may_have_exposed_new_symbols.
  5777. (get_value_for, set_value_for): Lose "table" argument. Update
  5778. callers. Use const_and_copies table directly.
  5779. (lookup_avail_expr): Lose "const_and_copies" argument. Callers
  5780. updated.
  5781. (get_eq_expr_value): Similarly. Also accept a pointer to the
  5782. vrp_variables. Callers updated.
  5783. (update_rhs_and_lookup_avail_expr): Similarly.
  5784. (record_cond_is_true, record_cond_is_false): Similarly.
  5785. (simplify_rhs_and_lookup_avail_expr): Similarly.
  5786. (simplify_cond_and_lookup_avail_expr): Similarly.
  5787. (record_equivalences_from_phis): Similarly.
  5788. (record_equivalences_from_incoming_edge): Similarly. Also accept
  5789. a pointer to the block const_and_copies table and vrp_variables.
  5790. Callers updated.
  5791. (eliminate_redundant_computations): Similarly
  5792. (record_equivalences_from_stmt, thread_through_successor): Similarly.
  5793. (dom_opt_initialize_block): New function. Perform block local
  5794. initialization for the dominator optimizer.
  5795. (dom_opt_finalize_block): Renamed from finalize_block. Get
  5796. block local varrays from walk_data. Pop entry off block local
  5797. data stack when complete.
  5798. (dom_opt_walk_stmts): New function.
  5799. (cprop_into_phis): Get block local varrays from walk_data.
  5800. (record_range): Get vrp varray by reference than by value.
  5801. (tree_ssa_dominator_optimize): Store incoming "vars" variable into
  5802. global "vars_to_rename". Initialize walk_data. Use
  5803. walk_dominator_tree.
  5804. (cprop_into_stmt): Initialize may_have_exposed_new_symbols.
  5805. * tree-ssa.c: Include domwalk.h
  5806. (rewrite_finalize_block, rewrite_initialize_block): New functions
  5807. extracted from rewrite_block.
  5808. (rewrite_walk_stmts, rewrite_add_phi_arguments): Similarly.
  5809. (rewrite_block): Kill.
  5810. (rewrite_into_ssa): Initialize walk_data. Use walk_dominator_tree.
  5811. 2003-10-14 Richard Henderson <rth@redhat.com>
  5812. * gimplify.c (gimplify_expr): Return bool. Bail gracefully if
  5813. fb_mayfail is set.
  5814. (gimplify_asm_expr): Take pointer-to-expr. Allow gimplify_expr
  5815. to fail for lvalues, and issue appropriate error messages. Zap
  5816. the entire asm statement on failure.
  5817. * tree-simple.h (enum fallback_t): Add fb_mayfail.
  5818. 2003-10-14 Richard Henderson <rth@redhat.com>
  5819. * c-tree.h (C_LANG_TREE_NODE_CHAIN_NEXT): New.
  5820. (union lang_tree_node): Use it for chain_next annotation.
  5821. 2003-10-14 Richard Henderson <rth@redhat.com>
  5822. * c-common.c: Include tree-iterator.h.
  5823. (c_expand_expr): Kill warn_unused_result checks.
  5824. (c_warn_unused_result): New.
  5825. * c-common.h (STMT_EXPR_WARN_UNUSED_RESULT): Remove.
  5826. (c_warn_unused_result): Declare.
  5827. * c-decl.c (finish_function): Always gimplify. Call
  5828. c_warn_unused_result.
  5829. * calls.c (expand_call): Kill warn_unused_result checks.
  5830. * Makefile.in (c-common.o): Update.
  5831. 2003-10-15 Steven Bosscher <steven@gcc.gnu.org>
  5832. * cfghooks.c (dump_bb): Take extra `int indent' argument.
  5833. * cfg.c (dump_bb): Take extra argument to match cfg hook.
  5834. Write out all information about bb that is shared between the tree
  5835. and rtl representations.
  5836. * basic-block.c (dump_bb): Adjust prototype.
  5837. * cfgrtl.c (rtl_dump_bb): Update prototype to match cfg hook.
  5838. Use indent.
  5839. * flow.c (verify_wide_reg, verify_local_live_at_start):
  5840. Fixup dump_bb calls.
  5841. * tree-cfg.c (dump_tree_bb): Rename to tree_dump_bb. Remove unused
  5842. `prefix' argument. Put in tree_cfg_hooks as cfg hook for dump_bb.
  5843. (remove_bb, debug_tree_bb, dump_tree_cfg): Call dump_bb.
  5844. * tree-ssa (dump_tree_ssa): Likewise.
  5845. * tree-flow.h (dump_tree_bb): Replace with new tree_dump_bb
  5846. prototype.
  5847. * tree-pretty-print (dump_block_info): Match case of BLOCK, SUCC,
  5848. PRED with dump_bb.
  5849. 2003-10-14 Daniel Berlin <dberlin@dberlin.org>
  5850. * tree-alias-ander.c (throwaway_global): Delete.
  5851. (andersen_same_ponts_to_set): We handle all globals individually
  5852. now.
  5853. * tree-alias-common.c: Remove doxygen markers.
  5854. (get_alias_var_decl): Always create an alias var for globals now.
  5855. Assign the global alias vars to GLOBAL_VAR, too.
  5856. (intra_function_call): Fix logic, do a bit of pre-filtering to
  5857. avoid useless global aliasing.
  5858. (get_values_from_constructor): It's the same for field based and
  5859. not field based.
  5860. (create_alias_vars): Remove special global var handling.
  5861. (same_points_to_set): Ditto.
  5862. (ptr_may_alias_var): Ditto.
  5863. 2003-10-14 Jeff Law <law@redhat.com>
  5864. * tree-ssa-dom.c (cprop_into_phis): Avoid doing useless work if the
  5865. edge we care about is abnormal.
  5866. * tree-ssa-copyprop (cprop_phi): Avoid doing useless work if the
  5867. destination of the PHI node occurs in an abnormal PHI.
  5868. * tree-ssa-dom.c (record_equivalences_from_stmt): Renamed from
  5869. record_equivalances. Caller updated.
  5870. (record_equivalences_from_phis): New function extracted from
  5871. optimize_block.
  5872. (record_equivalences_from_incoming_edge): Likewise.
  5873. (record_equivalances_from_block_entry): Likewise.
  5874. (cprop_into_phis): Likewise.
  5875. (optimize_stmt): Lots of code moved into new functions. Call
  5876. record_equivlances_from_block_entry.
  5877. * tree-ssa-dom.c (optimize_block): Simplify interface slightly.
  5878. Use finalize_block. Extract edge_flags from our block's
  5879. incoming edge as necessary. Simplify recursive call.
  5880. (thread_through_successor): Extracted from optimize_block.
  5881. (finalize_block): Similarly.
  5882. * tree-ssa-dom.c (eliminate_redundant_computations): New function
  5883. extracted from optimize_stmt.
  5884. (record_equivalences): Similarly.
  5885. (optimize_stmt): Use eliminate_redundant_computations and
  5886. record_equivalences. If fold_stmt changes stmt, then make sure
  5887. to get a new annotation as well.
  5888. * tree-cfg.c (cleanup_control_flow): Pass last statement down to
  5889. cleanup_cond_expr_graph and cleanup_switch_expr_graph.
  5890. (cleanup_cond_expr_graph): Accept statement from caller and
  5891. use it. Return nonzero if the predicate was constant. No longer
  5892. static.
  5893. (cleanup_switch_expr_graph): Similarly.
  5894. (disconnect_unreachable_case_labels): Similarly, except that it
  5895. is still static.
  5896. * tree-flow.h (cleanup_cond_expr_graph): Prototype.
  5897. (cleanup_switch_expr_graph): Similarly.
  5898. * tree-ssa-dom.c (optimize_stmt): Also optimize the condition
  5899. in a SWITCH_EXPR. Use COND_EXPR_COND and SWITCH_COND to get
  5900. conditions instead of relying upon known operand positions.
  5901. Use cleanup_cond_expr_graph and cleanup_switch_expr_graph rather
  5902. than open coding equivalents.
  5903. (lookup_avail_expr): Handle SWITCH_EXPRs. Use COND_EXPR_COND and
  5904. SWITCH_COND to get conditions instead of relying upon known
  5905. operand positions.
  5906. (avail_expr_hash, avail_expr_eq): Similarly.
  5907. 2003-10-14 Richard Henderson <rth@redhat.com>
  5908. * gimplify.c (gimplify_body): Save and restore input_location;
  5909. initialize input_location to DECL_SOURCE_LOCATION.
  5910. (gimplify_expr): Always save and restore input_location.
  5911. 2003-10-14 Richard Henderson <rth@redhat.com>
  5912. * expr.c (expand_expr): Break out EXPR_LOCUS code from ...
  5913. (expand_expr_1): ... here, renamed from expand_expr.
  5914. 2003-10-13 Richard Henderson <rth@redhat.com>
  5915. * c-simplify.c (c_gimplify_stmt): Upreate on location_t and not
  5916. fine and line individually.
  5917. (gimplify_c_loop, gimplify_switch_stmt): Likewise.
  5918. * gimplify.c (wfl_locus): Merge wfl_filename+wfl_lineno.
  5919. (annotate_all_with_locus_1): Rename from annotate_stmt_with_file_line.
  5920. (annotate_all_with_locus): Replace annotate_all_with_file_line;
  5921. update all callers.
  5922. * tree-simple.h: Update.
  5923. * tree.c, tree.h (annotate_with_locus): New.
  5924. 2003-10-13 Steven Bosscher <steven@gcc.gnu.org>
  5925. * tree-flow-inline.h (def_ops): Take a stmt_ann_t as argument
  5926. instead of a tree.
  5927. (use_ops): Likewise.
  5928. (vdef_ops): Likewise.
  5929. (vuse_ops): Likewise.
  5930. * tree-flow.h: Update prototypes.
  5931. * tree-cfg.c (remove_stmt): Load the statement annotation.
  5932. Adjust *_ops calls.
  5933. * tree-dfa.c (compute_immediate_uses_for_stmt,
  5934. mark_new_vars_to_rename): Likewise.
  5935. * tree-pretty-print.c (dump_vops): Likewise.
  5936. * tree-ssa-ccp.c (tree_ssa_ccp): Likewise. Also remove now
  5937. superfluous stmt_ann() calls.
  5938. (visit_stmt, cpp_fold, add_var_to_ssa_edges_worklist,
  5939. initialize, replace_uses_in, likely_value): Likewise.
  5940. * tree-ssa-copyprop.c (copyprop_stmt): Likewise.
  5941. * tree-ssa-dce.c (stmt_useful_p, process_worklist): Likewise.
  5942. * tree-ssa-dom.c (cprop_into_stmt, optimize_stmt,
  5943. avail_expr_hash, avail_expr_eq):
  5944. Likewise.
  5945. * tree-ssa-live.c (create_ssa_var_map, calculate_live_on_entry,
  5946. build_tree_conflict_graph): Likewise.
  5947. * tree-ssa-pre.c (maybe_find_rhs_use_for_var,
  5948. expr_phi_insertion, same_e_version_real_occ_real_occ,
  5949. generate_expr_as_of_bb, bool load_modified_real_occ_real_occ,
  5950. bool same_e_version_phi_result, get_default_def,reaching_def,
  5951. tree_perform_ssapre): Likewise.
  5952. * tree-ssa.c (mark_def_sites, rewrite_out_of_ssa, rewrite_stmt):
  5953. Likewise.
  5954. 2003-10-12 Richard Henderson <rth@redhat.com>
  5955. * gimplify.c (gimplify_array_ref_to_plus): Be prepared for
  5956. null TYPE_DOMAIN or TYPE_MIN_VALUE for the array.
  5957. * tree-ssa-ccp.c (fold_indirect_refs_r): Likewise.
  5958. 2003-10-12 Richard Henderson <rth@redhat.com>
  5959. * tree.h (struct tree_common): Rename unused_1 to invariant_flag.
  5960. (TREE_INVARIANT): New.
  5961. * builtins.c (build_string_literal): Set TREE_INVARIANT.
  5962. * c-common.c (fix_string_type): Likewise.
  5963. * c-typeck.c (build_external_ref): Likewise.
  5964. (build_c_cast, pop_init_level): Likewise.
  5965. * fold-const.c (fold_convert, fold): Likewise.
  5966. * tree.c (make_node, build_constructor): Likewise.
  5967. (build, build1): Likewise.
  5968. (staticp): Pass unknown component references to the language.
  5969. (save_expr): Check TREE_INVARIANT instead of TREE_CONSTANT.
  5970. (skip_simple_arithmetic): Likewise.
  5971. (stabilize_reference_1): Likewise.
  5972. * print-tree.c (print_node): Print TREE_INVARIANT.
  5973. * c-common.c (pointer_int_sum): Rely on build to set TREE_CONSTANT.
  5974. (finish_label_address_expr): Likewise.
  5975. * c-typeck.c (default_function_array_conversion): Likewise.
  5976. (parser_build_binary_op, pointer_diff): Likewise.
  5977. (build_unary_op, build_binary_op): Likewise.
  5978. * fold-const.c (non_lvalue): Likewise.
  5979. * tree-pretty-print.c (dump_generic_node): Handle VIEW_CONVERT_EXPR.
  5980. 2003-10-12 Richard Henderson <rth@redhat.com>
  5981. Diego Novillo <dnovillo@redhat.com>
  5982. * gimplify.c (gimplify_array_ref_to_plus): Subtract the array
  5983. domain minimum index.
  5984. (gimplify_addr_expr): Expand ARRAY_REFs. Cope with Fortran
  5985. missing cast wierdnesses.
  5986. * tree-dfa.c (get_expr_operands): Handle (&v + c); abort on
  5987. other address invariants that should have been folded.
  5988. (vdefs_disappeared_p): New.
  5989. (mark_new_vars_to_rename): Use it. Move from ...
  5990. * tree-ssa-dom.c: ... here.
  5991. * tree-flow-inline.h (is_unchanging_value): Remove; use
  5992. is_gimple_min_invariant everywhere instead.
  5993. (phi_ssa_name_p): New.
  5994. * tree-must-alias.c (find_addressable_vars): Process PHIs.
  5995. * tree-simple.c (is_gimple_min_invariant): Rename from
  5996. is_gimple_const; allow non-static variable addresses; update callers.
  5997. (is_gimple_val): Remove ADDR_EXPR checks.
  5998. * tree-simple.h: Update.
  5999. * tree-ssa-ccp.c (replace_uses_in): Add replaced_address argument.
  6000. (substitute_and_fold): Use that to mark_new_vars_to_rename.
  6001. (fold_indirect_refs_r): New.
  6002. (fold_stmt): Use it.
  6003. * tree-ssa-copyprop.c (copyprop_stmt): Call fold_stmt.
  6004. * tree-ssa-dce.c (NECESSARY): Use asm_written_flag.
  6005. (mark_necessary): Reject DECLs.
  6006. * tree-ssa-live.c (register_ssa_partition): Use phi_ssa_name_p.
  6007. * tree-ssa-pre.c (generate_expr_as_of_bb): Call fold_stmt if we
  6008. replaced with constants.
  6009. * tree-ssa.c (insert_copy_on_edge): Unwrap ADDR_EXPRs to set_is_used.
  6010. (eliminate_build, coalesce_abnormal_edges, coalesce_vars): Use
  6011. phi_ssa_name_p.
  6012. 2003-10-09 Frank Ch. Eigler <fche@redhat.com>
  6013. java/12211
  6014. * gimplify.c (gimplify_save_expr): Tolerate void-typed saved
  6015. expressions.
  6016. 2003-10-09 Diego Novillo <dnovillo@redhat.com>
  6017. * tree-dfa.c (add_call_clobber_ops): If a variable is read-only,
  6018. add a VUSE operand instead of VDEF.
  6019. 2003-10-08 Jason Merrill <jason@redhat.com>
  6020. PR optimization/12525
  6021. * tree-dfa.c (note_addressable): New fn, split out from...
  6022. (add_stmt_operands): Here.
  6023. (get_stmt_operands) <ASM_EXPR>: Call it for mem ops.
  6024. * gimplify.c (gimplify_asm_expr): Call parse_input_constraint
  6025. directly. It's only a mem op if allows_mem is set.
  6026. 2003-10-08 Diego Novillo <dnovillo@redhat.com>
  6027. PR/12187
  6028. * tree-dfa.c (add_stmt_operand): Test against current_function_decl
  6029. when checking for global variables.
  6030. (may_access_global_mem_p): Likewise.
  6031. (add_referenced_var): Likewise.
  6032. Consider DECL_NONLOCAL variables call clobbered and used.
  6033. (find_hidden_use_vars): Do not test for DECL_NONLOCAL variables.
  6034. * tree-optimize.c (tree_rest_of_compilation): Test against
  6035. current_function_decl when checking for global variables.
  6036. * tree-ssa-ccp.c (get_default_value): Likewise.
  6037. * tree-ssa-dce.c (need_to_preserve_store): Likewise.
  6038. 2003-10-07 Jason Merrill <jason@redhat.com>
  6039. PR optimization/12525
  6040. * gimplify.c (gimplify_asm_expr): If the constraint doesn't allow
  6041. a register, call mark_addressable. Split an in/out operand that
  6042. does allow a register into separate input and output operands.
  6043. 2003-10-06 Richard Henderson <rth@redhat.com>
  6044. * fold-const.c (fold): Fold (T1)((T2)X op Y) into (T1)X op Y,
  6045. for suitable values of T1 & T2.
  6046. 2003-10-06 Andrew Macleod <amacleod@redhat.com>
  6047. * tree-dfa.c (compute_immediate_uses): Add optional callback.
  6048. (compute_immediate_uses_for_phi): Remove unused parameter. Add optional
  6049. callback to determine if usage info should be calculated for variable.
  6050. (compute_immediate_uses_for_stmt): Add optional callback to determine
  6051. if usage info should be calculated for variable.
  6052. * tree-flow.h (compute_immediate_uses): Update prototype.
  6053. * tree-ssa-ccp.c (need_imm_uses_for): New. Callback function passed to
  6054. compute_immediate_uses.
  6055. (initialize): Calculate defaults initially, then build reduced
  6056. immediate use information.
  6057. (get_default_value): Non empty stmt's which are not a PHI_NODE or
  6058. a MODIFY_EXPR default to VARYING.
  6059. 2003-10-06 Andrew Macleod <amacleod@redhat.com>
  6060. * tree-cfg.c (tree_split_edge): Mark edge as FALLTHRU when splitting.
  6061. 2003-10-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  6062. * tree-ssa.c (rewrite_block): Test vars_to_rename instead of
  6063. PHI_ARG_CAPACITY.
  6064. * tree-dfa.c (remove_phi_arg_num): Don't update
  6065. PHI_ARG_CAPACITY.
  6066. 2003-10-01 Richard Henderson <rth@redhat.com>
  6067. * c-decl.c (set_decl_nonlocal): New.
  6068. (store_parm_decls): Use it via walk_tree.
  6069. 2003-10-01 Jeff Law <law@redhat.com>
  6070. * tree-ssa-dom.c (cprop_into_stmt): New function extracted from
  6071. optimize_stmt.
  6072. (optimize_stmt): Use cprop_into_stmt.
  6073. 2003-09-30 Richard Henderson <rth@redhat.com>
  6074. * function.h (struct function): Add function_end_locus.
  6075. * c-decl.c (finish_function): Set it.
  6076. * tree-optimize.c (tree_rest_of_compilation): Set input_location
  6077. to function_end_locus before expand_function_end.
  6078. * tree-optimize.c (optimize_function_tree): Move calls to
  6079. remove_useless_stmts_and_vars and lower_eh_constructs ...
  6080. (tree_rest_of_compilation): ... here.
  6081. * c-simplify.c (gimplify_expr_stmt): Don't warn for any statement
  6082. with void result type.
  6083. 2003-09-30 Jeff Law <law@redhat.com>
  6084. * tree-ssa-dom.c (simplify_cond_and_lookup_avail_expr): Fix thinko
  6085. in test for swapping ranges.
  6086. * tree-ssa-dom.c (record_range): New function.
  6087. (extract_range_from_cond): Likewise.
  6088. (tree_ssa_dominator_optimize): Initialize the vrp_data varray.
  6089. (optimize_block): Initialize the vrp_variables varray. Wipe
  6090. appropriate entries from the VRP varrays when done processing a block.
  6091. (get_eq_expr_value): Accept new argument "bb". Call record_range
  6092. appropriately. Refactor code to avoid useless work.
  6093. (simplify_cond_and_lookup_avail_expr): Use value range records to
  6094. simplify conditions.
  6095. (simplify_rhs_and_lookup_avail_expr): When simplifying ABS_EXPR,
  6096. DIV_EXPR and MOD_EXPR, use simplify_cond_and_lookup_avail_expr
  6097. to determine the range of the given variable.
  6098. * tree-ssa-dom.c (find_equivalent_equality_comparison): Do not
  6099. look through a typecast which narrows a value.
  6100. 2003-09-30 Paul Brook <paul@nowt.org>
  6101. * Makefile.in: Add rules for check-gfortran.
  6102. 2003-09-29 Richard Henderson <rth@redhat.com>
  6103. * gimplify.c (gimplify_cond_expr): Fix both arms dead return value.
  6104. 2003-09-29 Jeff Law <law@redhat.com>
  6105. * tree-ssa-dom.c (simplify_cond_and_lookup_avail_expr): New function.
  6106. (find_equivalent_equality_comparison): Likewise.
  6107. (optimize_block): Remove code to build a == c equivalence after
  6108. seeing a == b and b == c. Remove code to walk backwards
  6109. though typecasts to record equivalences and move relevant parts
  6110. into find_equivalent_equality_comparison.
  6111. (optimize_stmt): Call simplify_cond_and_lookup_avail_expr.
  6112. 2003-09-28 Richard Henderson <rth@redhat.com>
  6113. * gimplify.c (gimplify_call_expr): Annotate all call_exprs.
  6114. * tree-inline.c (expand_call_inline): Set input_location based
  6115. on EXPR_LOCUS; save and restore input_location around that.
  6116. (walk_tree): Do not set input_location.
  6117. 2003-09-27 Graham Stott <graham.stott@btinternet.com>
  6118. * expr.c (expand_expr)[CATCH_EXPR]: Fix bogus return value.
  6119. 2003-09-26 Andrew MacLeod <amacloeod@redhat.com>
  6120. * tree-ssa-dom.c (struct var_value_d): Remove.
  6121. (const_and_copies): Change to a varray_type.
  6122. (tree_ssa_dominator_optimize): Initialize const_and_copies as a varray.
  6123. (optimize_block): Simply set the value in const_and_copies.
  6124. (dump_dominator_optimization_stats): No hash stats for const_and_copies.
  6125. (record_cond_is_true, record_cond_is_false,
  6126. simplify_rhs_and_lookup_avail_expr, update_rhs_and_lookup_avail_expr):
  6127. Parameter const_and_copies is now a varray_type.
  6128. (var_value_hash, var_value_eq): Remove.
  6129. (get_value_for, set_value_for): Access varray elements.
  6130. (get_eq_expr_value): Parameter const_and_copies is now a varray_type.
  6131. * tree-cfg.c (handle_switch_split): Update container of previous stmt.
  6132. 2003-09-25 Daniel Berlin <dberlin@dberlin.org>
  6133. * tree-ssa-pre.c (split_critical_edges): New function, temporarily
  6134. disabled until some edge splitting/insertion problems are fixed.
  6135. (opnum_of_ephi): Take an edge argument, constify. Use hash table lookup.
  6136. Update all callers.
  6137. (ephi_pindex_eq): New function.
  6138. (ephi_pindex_hash): New function.
  6139. (ephi_pindex_htab): New variable.
  6140. (add_ephi_pred): Update hash table.
  6141. (expr_phi_insertion): Don't free the bitmap returned by compute_idfs
  6142. anymore.
  6143. (idfs_cache): New variable.
  6144. (compute_idfs): Rewrite to use cache as much as possible, and not
  6145. recompute when we can avoid it.
  6146. 2003-09-25 Daniel Berlin <dberlin@dberlin.org>
  6147. * tree-alias-ander.c: Fixup comment spacing.
  6148. (andersen_op_assign): Handle >2 operands case.
  6149. 2003-09-24 Steven Bosscher <steven@gcc.gnu.org>
  6150. * tree-dfa.c (compute_immediate_uses_for): Split up in two
  6151. separate functions, one for PHIs and one for normal statements.
  6152. (compute_immediate_uses_for_phi): New.
  6153. (compute_immediate_uses_for_stmt): New.
  6154. 2003-09-25 Jeff Law <law@redhat.com>
  6155. * tree-ssa-dom.c (optimize_block): When EQ_EXPR_VALUE has the
  6156. form DEST = SRC where both DEST and SRC are SSA_NAMEs also
  6157. record SRC = DEST into the const and copies table.
  6158. * tree-ssa-dom.c (optimize_block): Change tests which checked
  6159. for SSA_VAR_P to only allow SSA_NAMEs.
  6160. (get_value_for, set_value_for): Likewise.
  6161. (lookup_avail_expr, get_eq_expr_value): Likewise.
  6162. 2003-09-25 Andrew MacLeod <amacleod@redhat.com>
  6163. * tree-ssa-dce.c (pdom_info, needed_stmts): Remove.
  6164. (NECESSARY): Define.
  6165. (necessary_p): Check bit instead of hash table lookup.
  6166. (clear_necessary): New. Clear necessary bit.
  6167. (mark_necessary): Use bit instead of hash table. No control lookup.
  6168. (mark_tree_necessary): Remove.
  6169. (find_useful_stmts): Clear necessary bit before checking it.
  6170. (stmt_useful_p): Remove GOTO_EXPR case. Check arms of COND_EXPR for
  6171. GOTO. All other control flow stmts are necessary.
  6172. (process_worklist): Dont look for control parents.
  6173. (remove_dead_stmts): No dominattor info is necessary.
  6174. (remove_dead_stmt): Don't need BB any more. Remove COND_EXPR by changing
  6175. the condition to 'if (0)'. Abort on other control flow.
  6176. (tree_ssa_dce): No longer need the hash table.
  6177. (remove_conditional): Remove.
  6178. 2003-09-25 Andreas Schwab <schwab@suse.de>
  6179. * tree-flow.h: Declare next_ssa_version.
  6180. * tree-ssa-ccp.c: Remove conflicting declaration.
  6181. * tree-ssa-live.c: Likewise.
  6182. * tree.c (make_ssa_name): Likewise.
  6183. 2003-09-24 Jason Merrill <jason@redhat.com>
  6184. * tree.h (DECL_SOURCE_LOCATION): Resurrect.
  6185. (DECL_SOURCE_FILE, DECL_SOURCE_LINE): Likewise.
  6186. (EXPR_LOCUS): Renamed from TREE_LOCUS. Null for non-exprs.
  6187. (SET_EXPR_LOCUS): New macro.
  6188. (EXPR_FILENAME): Renamed from TREE_FILENAME.
  6189. (EXPR_LINENO): Renamed from TREE_LINENO.
  6190. (struct tree_common): Remove locus field.
  6191. (struct tree_decl): Re-add locus field.
  6192. (struct tree_expr): Add locus field.
  6193. * c-aux-info.c, c-decl.c, coverage.c, c-parse.in, dbxout.c,
  6194. diagnostic.c, dwarf2out.c, expr.c, function.c, gimplify.c,
  6195. integrate.c, print-tree.c, stmt.c, tree.c, tree-cfg.c,
  6196. tree-dump.c, tree-flow-inline.h, config/alpha/alpha.c,
  6197. config/mips/mips.c: Adjust.
  6198. 2003-09-24 Andrew MacLeod <amacleod@redhat.com>
  6199. * tree-ssa-ccp.c (enum latticevalue): Add UNINITIALIZED.
  6200. (const_values, struct value_map_d): Remove hash table structures.
  6201. (value_vector): New array of values.
  6202. (get_value): Use value_vector instead of hash table. Mark inline.
  6203. (visit_phi_node): Ignore arguments if the PHI result is already VARYING.
  6204. (initialize): Initialize value vector instead of hash table.
  6205. (finalize): Free value vector instead of hash table.
  6206. (add_var_to_ssa_edges_worklist): Don't add to worklist if
  6207. DONT_SIMULATE_AGAIN flag is set.
  6208. (value_map_hash, value_map_eq): Delete.
  6209. 2003-09-24 Jeff Law <law@redhat.com>
  6210. * tree-ssa-dom.c (optimize_block): Create infrastructure for
  6211. tracking const_and_copies equivalences which disappear when
  6212. we leave the current block. Use it for equivalences created
  6213. by EQ_EXPR_VALUE. Follow use-def chains for EQ_EXPR_VALUE
  6214. equivalences and see if certain NOP_EXPRs can be ignored
  6215. to create a block-local equivalence for const_and_copies.
  6216. (optimize_stmt): Do not get confused by a cast of the return
  6217. value from alloca or the address of a non-weak decl.
  6218. * fold-const.c (fold_read_from_constant_string): New function.
  6219. * tree.h (fold_read_from_constant_string): Prototype.
  6220. * expr.c (expand_expr, case INDIRECT_REF): Use it.
  6221. (expand_expr, case ARRAY_REF): Likewise. Put checking code
  6222. inside an ENABLE_CHECKING.
  6223. * tree-ssa-ccp.c (fold_stmt): Use fold_read_from_constant_string.
  6224. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise.
  6225. 2003-09-23 Jeff Law <law@redhat.com>
  6226. * tree-ssa-dom.c (optimize_block): Ignore "useless" type
  6227. conversions in SWITCH_COND when creating equivalenecs at
  6228. case labels.
  6229. 2003-09-22 Jeff Law <law@redhat.com>
  6230. * tree-ssa-dom.c (optimize_stmt): Addresses of non-weak symbols
  6231. as well as dynamically allocated stack space are always nonzero.
  6232. * tree-cfg.c (handle_switch_split): Properly mark the fallthru
  6233. edge from SRC to DEST with EDGE_FALLTHRU.
  6234. 2003-09-22 Daniel Berlin <dberlin@dberlin.org>
  6235. * tree-flow.h (struct bb_ann_d): Add erefs array.
  6236. * tree-ssa-pre.c (handle_bb_creation): Remove ei parameter.
  6237. Update caller.
  6238. (struct expr_info): Remove erefs array.
  6239. (append_eref_to_block): New function.
  6240. (clear_all_eref_arrays): Ditto.
  6241. (expr_phi_insertion): Use append_eref_to_block.
  6242. (insert_occ_in_preorder_dt_order_1): Ditto.
  6243. (subst_phis): Only copy expression, not the containing EUSE/EPHI.
  6244. Update all callers to reflect this.
  6245. (compute_will_be_avail): Update for per-block eref array.
  6246. (handle_bb_creation): Ditto.
  6247. (pre_expression): Ditto.
  6248. (tree_perform_ssapre): Clear eref arrays when done with expression.
  6249. 2003-09-22 Diego Novillo <dnovillo@redhat.com>
  6250. * tree-cfg.c (dump_tree_bb): Remove superlfuous newlines.
  6251. 2003-09-21 Diego Novillo <dnovillo@redhat.com>
  6252. * tree-dfa.c (compute_alias_sets): Use TDI_alias instead of
  6253. TDI_ssa.
  6254. * tree-dump.c (dump_files): Add enties for TDI_alias, TDI_ssa1,
  6255. TDI_dom1, TDI_ssa2, TDI_dce1, TDI_ssa3, TDI_dom2, TDI_ssa4,
  6256. TDI_ssa5 and TDI_dce2.
  6257. Remove entries for TDI_ssa, TDI_dom and TDI_dce.
  6258. * tree.h (enum tree_dump_index): Similarly.
  6259. (TDF_ALIAS): Remove.
  6260. (TDF_VOPS): Change value.
  6261. * doc/invoke.texi (-fdump-tree-alias): Document.
  6262. * tree-flow.h (tree_warn_uninitialized): Remove unused variable.
  6263. (rewrite_into_ssa): Add enum tree_dump_index argument. Update all
  6264. callers.
  6265. (rewrite_out_of_ssa): Likewise.
  6266. (tree_perform_ssa_pre): Likewise.
  6267. (tree_ssa_dominator_optimize): Likewise.
  6268. (tree_ssa_dce): Likewise.
  6269. (tree_ssa_copyprop): Likewise.
  6270. (tree_ssa_ccp): Likewise.
  6271. Add sbitmap argument.
  6272. (tree_compute_must_alias): Likewise.
  6273. (mark_new_vars_to_rename): Declare.
  6274. * tree-must-alias.c (tree_compute_must_alias): Do not call
  6275. rewrite_into_ssa.
  6276. Remove local vars_to_rename. Use new argument instead.
  6277. * tree-optimize.c (optimize_function_tree): Re-write optimization
  6278. ordering to support passes that need the SSA form updated.
  6279. Call tree_ssa_dominator_optimize.
  6280. Re-arrange optimization ordering.
  6281. * tree-ssa-ccp.c (substitute_and_fold): Take new argument
  6282. vars_to_rename.
  6283. Call mark_new_vars_to_rename.
  6284. (visit_phi_node): Move variable 'val' into the right scope.
  6285. (initialize): Move call dump_begin ...
  6286. (tree_ssa_ccp): ... here.
  6287. * tree-ssa-dom.c (mark_new_vars_to_rename): Declare extern.
  6288. Make sure that variables in virtual operands aren't marked
  6289. unnecessarily.
  6290. * tree-ssa.c (rewrite_into_ssa): Do not call
  6291. tree_ssa_dominator_optimize.
  6292. 2003-09-21 Diego Novillo <dnovillo@redhat.com>
  6293. * tree-ssa-dce.c (dom_info): Remove unused variable.
  6294. * tree-ssa-dom.c (tree_ssa_dominator_optimize): If the CFG has been
  6295. altered, call cleanup_tree_cfg.
  6296. Call cleanup_tree_cfg before returning.
  6297. * tree-ssa-pre.c (tree_perform_ssapre): Call get_stmt_operands
  6298. before processing the statement.
  6299. * tree-ssa-dom.c (thread_edge): Remove attribute EDGE_FALLTHRU from
  6300. edge.
  6301. 2003-09-21 Jeff Law <law@redhat.com>
  6302. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Break out of
  6303. optimize_stmt. Follow the def-use chains back for certain expressions
  6304. to see if we can simplify the RHS of the current expression based
  6305. on earlier expressions.
  6306. * tree-ssa-dom.c (optimize_block): Rework code to propagate values
  6307. into PHI nodes to be more efficient.
  6308. 2003-09-20 Andrew MacLeod <amacleod@redhat.com>
  6309. * tree-flow.h (struct dataflow_d): Remove reaching fields, add 2 element
  6310. vector of trees.
  6311. * tree-flow-inline.h (immediate_uses): Rename to get_immediate_uses,
  6312. return a dataflow object.
  6313. (reaching_defs): Remove until needed.
  6314. (num_immediate_uses): New. Return number of immediate uses.
  6315. (immediate_use): New. Return a specified immediate use.
  6316. * tree-dfa.c (add_immediate_use): Use new fields.
  6317. (dump_immediate_uses_for): Use new interface.
  6318. (create_phi_node): Chain to start of list.
  6319. * tree-ssa-ccp.c (add_var_to_ssa_edges_worklist): Use new interface.
  6320. * tree-ssa.c (compute_global_livein): Loop interchange.
  6321. 2003-09-18 Jeff Law <law@redhat.com>
  6322. * tree-ssa-dom.c (optimize_stmt): Allow optimizing the RHS of a
  6323. MODIFY_EXPR even if we can't record any equivalences created by
  6324. the MODIFY_EXPR. Move code to simplify ABS_EXPR, TRUNC_DIV_EXPR
  6325. and TRUNC_MOD_EXPR to an earlier position.
  6326. 2003-09-19 Andrew MacLeod <amacleod@redhat.com>
  6327. * tree-ssa-ccp.c (cfg_edges): Rename to cfg_blocks.
  6328. (cfg_blocks_num, cfg_blocks_head, cfg_blocks_tail): New. Queue markers.
  6329. (bb_in_list): New. Vector indicating if a BB is in the cfg_blocks list.
  6330. (tree_ssa_ccp): Use new routines.
  6331. (add_control_edge): Add to cfg_blocks list.
  6332. (initialize): Initialize new variables.
  6333. (finalize): Free allocations.
  6334. (cfg_blocks_empty): New. Is cfg_blocks queue list.
  6335. (cfg_blocks_add): New. Add a basic block to cfg_blocks list.
  6336. (cfg_blocks_pop): New. Get a basic_block from the list.
  6337. 2003-09-18 Richard Henderson <rth@redhat.com>
  6338. * tree-cfg.c (struct rusv_data): Add may_throw, may_branch.
  6339. (remove_useless_stmts_and_vars_1): Set them.
  6340. (remove_useless_stmts_and_vars_goto): Likewise.
  6341. (remove_useless_stmts_and_vars_tf): Transform to compound_expr
  6342. if only fallthrough.
  6343. (remove_useless_stmts_and_vars_tc): Kill region if nothrow.
  6344. Detect catch regions that don't propagate exceptions.
  6345. (remove_useless_stmts_and_vars): Zero entire data struct.
  6346. 2003-09-18 Richard Henderson <rth@redhat.com>
  6347. * tree-eh.c (lower_try_finally_dup_block): New.
  6348. (honor_protect_cleanup_actions, lower_try_finally_copy): Use it.
  6349. 2003-09-18 Richard Henderson <rth@redhat.com>
  6350. * tree-cfg (remove_useless_stmts_and_vars_cond,
  6351. remove_useless_stmts_and_vars_tf,
  6352. remove_useless_stmts_and_vars_tc,
  6353. remove_useless_stmts_and_vars_bind,
  6354. remove_useless_stmts_and_vars_goto): Break out of ...
  6355. (remove_useless_stmts_and_vars_1): ... here. Rename to _1;
  6356. take and use struct rusv_data.
  6357. (remove_useless_stmts_and_vars): New. Loop until no change.
  6358. * tree-flow.h (remove_useless_stmts_and_vars): Update decl.
  6359. * tree-ssa.c (rewrite_out_of_ssa): Don't loop here.
  6360. 2003-09-18 Richard Henderson <rth@redhat.com>
  6361. * tree-pretty-print.c (dump_generic_node): Don't double indent asms.
  6362. 2003-09-18 Richard Henderson <rth@redhat.com>
  6363. * tree-eh.c: Include langhooks.h, remove errors.h.
  6364. (decide_copy_try_finally): Use estimate_num_insns to choose
  6365. between copy and switch implementations.
  6366. * c-common.c (c_estimate_num_insns): Take an expr, not a decl.
  6367. * tree-inline.c (limits_allow_inlining): Pass it the body of the decl.
  6368. 2003-09-18 Jeff Law <law@redhat.com>
  6369. * tree-ssa-dom.c (lookup_avail_expr): New argument which indicates
  6370. if the expression should be entered into the hash table. All
  6371. callers updated.
  6372. (update_rhs_and_lookup_avail_expr): New function factored out
  6373. of optimize_stmt.
  6374. * tree.h (commutative_tree_code, associative_tree_code): Declare
  6375. * tree.c (commutative_tree_code, associative_tree_code): New
  6376. functions.
  6377. (iterative_hash_expr): Use commutative_tree_code.
  6378. * fold-const.c (operand_equal_p): Use commutative_tree_code
  6379. rather than inlining the communitivy check.
  6380. (fold, nondestructive_fold_binary_to_constant): Similarly.
  6381. 2003-09-18 Diego Novillo <dnovillo@redhat.com>
  6382. * Makefile.in (tree-eh.o): Add dependency on errors.h
  6383. * tree-eh.c: Include errors.h
  6384. 2003-09-17 Richard Henderson <rth@redhat.com>
  6385. * tree-cfg.c (remove_useless_stmts_and_vars): Revert last change.
  6386. * tree-flow.h, tree-ssa.c: Likewise.
  6387. 2003-09-17 Richard Henderson <rth@redhat.com>
  6388. * tree-eh.c (decide_copy_try_finally): Remove forgotten debug code.
  6389. 2003-09-17 Daniel Berlin <dberlin@dberlin.org>
  6390. * tree-ssa-pre.c (pick_ssa_name): New function.
  6391. (code_motion): Use it.
  6392. 2003-09-17 Richard Henderson <rth@redhat.com>
  6393. * tree-eh.c: New file.
  6394. * Makefile.in (OBJS-common): Add it.
  6395. (tree-eh.o): New.
  6396. * calls.c (emit_call_1): New argument for full call expr.
  6397. Check with lookup_stmt_eh_region to set REG_EH_REGION.
  6398. (expand_call): Likewise for tail-calls.
  6399. * except.c (struct eh_region): Add tree_label.
  6400. (gen_eh_region, gen_eh_region_cleanup, gen_eh_region_try,
  6401. gen_eh_region_catch, gen_eh_region_allowed,
  6402. gen_eh_region_must_not_throw, get_eh_region_number,
  6403. get_eh_region_may_contain_throw, get_eh_region_tree_label,
  6404. set_eh_region_tree_label, expand_resx_expr): New.
  6405. (expand_eh_region_start, expand_start_catch): Use them.
  6406. (expand_end_catch): Tidy.
  6407. (note_eh_region_may_contain_throw): Take region argument.
  6408. (note_current_region_may_contain_throw): New.
  6409. (get_exception_filter): Export.
  6410. (collect_eh_region_array): Export.
  6411. (remove_unreachable_regions): Check ERT_TRY based on reachability
  6412. of catches, not reachability of continue_label. Never remove
  6413. ERT_MUST_NOT_THROW regions.
  6414. (collect_rtl_labels_from_trees): New.
  6415. (convert_from_eh_region_ranges): Use it.
  6416. (connect_post_landing_pads): Handle dying cleanups.
  6417. (struct reachable_info): Add callback data.
  6418. (add_reachable_handler): Invoke the callback.
  6419. (foreach_reachable_handler): New.
  6420. (reachable_handlers): Use it.
  6421. (arh_to_landing_pad, arh_to_label): New.
  6422. (can_throw_internal_1): Split out from can_throw_internal.
  6423. (can_throw_external_1): Similarly.
  6424. * except.h: Update.
  6425. * expr.c (expand_expr): Handle RESX_EXPR, FILTER_EXPR.
  6426. * gimplify.c (gimplify_modify_expr): Use tree_could_trap_p.
  6427. * stmt.c (using_eh_for_cleanups_p): Export.
  6428. (expand_return): Allow any typed rhs.
  6429. * timevar.def (TV_TREE_EH): New.
  6430. * tree-cfg.c (eh_stack): Kill.
  6431. (build_tree_cfg): Don't set it. Kill code to handle EH.
  6432. (could_trap_p): Move to tree-eh.c as tree_could_trap_p.
  6433. (get_eh_region_type, make_try_expr_blocks, make_catch_expr_blocks,
  6434. make_eh_filter_expr_blocks, try_finallys): Kill.
  6435. (make_edges): Kill code to handle EH.
  6436. (make_ctrl_stmt_edges): Kill TRY_FINALLY_EXPR, CATCH_EXPR,
  6437. EH_FILTER_EXPR. Handle RESX_EXPR.
  6438. (make_call_expr_edges): Kill.
  6439. (make_exit_edges): Use make_eh_edges.
  6440. (label_to_block): New.
  6441. (make_goto_expr_edges): Use it.
  6442. (is_ctrl_stmt): Add RESX_EXPR.
  6443. (is_ctrl_altering_stmt): Restructure. Use tree_can_throw_internal.
  6444. (last_exec_block, compute_reachable_eh): Kill.
  6445. * tree-dfa.c (get_stmt_operands): Add RESX_EXPR.
  6446. (get_expr_operands): Add FILTER_EXPR.
  6447. * tree-dump.c (dump_files): Add tree-eh.
  6448. * tree-flow.h (struct stmt_ann_d): Kill reachable_exception_handlers.
  6449. (label_to_block, lower_eh_constructs, make_eh_edges,
  6450. tree_could_trap_p, tree_could_throw_p, tree_can_throw_internal,
  6451. tree_can_throw_external): Declare.
  6452. * tree-optimize.c (optimize_function_tree): Call lower_eh_constructs.
  6453. (tree_rest_of_compilation): Save tree for inlining.
  6454. * tree-pretty-print.c (dump_generic_node): Handle FILTER_EXPR,
  6455. RESX_EXPR.
  6456. * tree-simple.c (is_gimple_stmt): Add RESX_EXPR.
  6457. (is_gimple_val): Add FILTER_EXPR.
  6458. * tree-ssa-dce.c (stmt_useful_p): Restructure. Add lhs of
  6459. EXC_PTR_EXPR or FILTER_EXPR.
  6460. * tree.def (FILTER_EXPR, RESX_EXPR): New.
  6461. * tree.h (enum tree_dump_index): Add TDI_eh.
  6462. 2003-09-17 Richard Henderson <rth@redhat.com>
  6463. * tree.c (tsi_link_before): Remove unnecessary parens.
  6464. (tsi_link_chain_before, tsi_delink): Likewise.
  6465. (tsi_link_after): Accept the case if the iterator points
  6466. to a NULL node; treat it as an empty list.
  6467. (tsi_link_chain_after): Likewise. Update iterator properly
  6468. for TSI_CHAIN_END.
  6469. 2003-09-17 Richard Henderson <rth@redhat.com>
  6470. * tree-inline.c (debug_find_tree_1, debug_find_tree): New.
  6471. 2003-09-17 Richard Henderson <rth@redhat.com>
  6472. * tree-cfg.c (struct rusv_data): New.
  6473. (remove_useless_stmts_and_vars_1): Rename from
  6474. remove_useless_stmts_and_vars. Use rusv_data. Handle goto-next
  6475. via remembering the last goto seen, and zapping it when appropriate.
  6476. (remove_useless_stmts_and_vars): New. Loop until done.
  6477. * tree-flow.h (remove_useless_stmts_and_vars): Update decl.
  6478. * tree-optimize.c (optimize_function_tree): Don't cache fnbody.
  6479. Dump data after remove_useless_stmts_and_vars.
  6480. * tree-ssa.c (rewrite_out_of_ssa): Kill loop around
  6481. remove_useless_stmts_and_vars.
  6482. * tree-dump.c (dump_files): Add .useless.
  6483. * tree.h (enum tree_dump_index): Add TDI_useless.
  6484. 2003-09-17 Diego Novillo <dnovillo@redhat.com>
  6485. * pretty-print.c (pp_write_text_to_stream): Export.
  6486. * pretty-print.h (pp_write_text_to_stream): Declare.
  6487. * tree-pretty-print.c (print_generic_stmt): Flush to file.
  6488. (dump_generic_node): Call pp_write_text_to_stream.
  6489. (maybe_init_pretty_print): Take file argument; associate the
  6490. stream with the buffer.
  6491. 2003-09-17 Jeff Law <law@redhat.com>
  6492. * tree-ssa-ccp.c (ccp_fold): If the return value has the wrong
  6493. type, try to convert it to the proper type rather than failing.
  6494. * tree-ssa-dom.c (optimize_stmt): Note that the statement is
  6495. modified, even if we just change the virtual operands. If
  6496. the statement was modified by const/copy propagation, then
  6497. set may_have_exposed_new_symbols.
  6498. 2003-09-17 Diego Novillo <dnovillo@redhat.com>
  6499. * tree-dfa.c (find_vars_r): Do not consider 'void *' pointers as
  6500. dereferenced when scanning function call arguments.
  6501. * tree-flow-inline.h (may_propagate_copy): Block propagation of
  6502. pointers when they have different memory tags.
  6503. * tree-ssa-copyprop.c (propagate_copy): When copy propagating
  6504. pointers, abort if the two pointers don't have identical memory
  6505. tags.
  6506. 2003-09-16 Jeff Law <law@redhat.com>
  6507. * tree-ssa-ccp.c (visit_stmt): Do not set DONT_SIMULATE_AGAIN
  6508. just because a statement as virtual definitions.
  6509. (likely_value): A CALL_EXPR is assumed to return a VARYING
  6510. result, regardless of its operands.
  6511. 2003-09-15 Jason Merrill <jason@redhat.com>
  6512. * tree-simple.c (is_gimple_val): Allow addresses of all decls.
  6513. (is_gimple_const): Allow addresses of all non-weak statics.
  6514. * tree-ssa-ccp.c (fold_stmt): Return bool.
  6515. * tree-flow.h: Adjust prototype.
  6516. * tree-ssa-dom.c (optimize_stmt): If folding changed stuff, we
  6517. need to recalculate the vops.
  6518. 2003-09-13 Diego Novillo <dnovillo@redhat.com>
  6519. Fix PR optimization/12268
  6520. * tree-dfa.c (add_referenced_var): Call-clobbered pointers may
  6521. point to global memory.
  6522. 2003-09-13 Jason Merrill <jason@redhat.com>
  6523. * c-common.c (c_apply_type_quals_to_decl): Unset TREE_READONLY for
  6524. types with constructors.
  6525. Remove superfluous references to TREE_TYPE (decl).
  6526. 2003-09-13 Diego Novillo <dnovillo@redhat.com>
  6527. * opts.c (decode_options): Enable must-alias optimization by default.
  6528. * tree-dfa.c (get_expr_operands): Always call add_stmt_operand when
  6529. dealing with ADDR_EXPR nodes.
  6530. (add_stmt_operand): If the variable has an alias set
  6531. of size zero, abort.
  6532. Call get_base_symbol() to retrieve the variable from an ADDR_EXPR
  6533. node.
  6534. (compute_alias_sets): Deep copy the aliases array when triggering
  6535. the alias grouping heuristic.
  6536. Don't group aliases if -ftree-must-alias is given.
  6537. * tree-must-alias.c (tree_compute_must_alias): Call
  6538. dump_referenced_vars when doing detailed dumps.
  6539. Rename promoted_vars to vars_to_rename. Update all users.
  6540. (find_addressable_vars): Always mark statements modified.
  6541. (promote_var): Also mark aliases of promoted variable to be
  6542. renamed.
  6543. Call find_variable_in and remove_element_from to update varrays for
  6544. call-clobbered variables and alias sets.
  6545. (find_variable_in): New local function.
  6546. (remove_element_from): New local function.
  6547. * varray.c (varray_copy): New function.
  6548. * varray.h (varray_copy): Declare.
  6549. 2003-09-13 Diego Novillo <dnovillo@redhat.com>
  6550. * tree-flow-inline.h (is_optimizable_addr_expr): Remove. Update
  6551. all users.
  6552. * tree-ssa-dom.c (optimize_stmt): Do not propagate SSA names from
  6553. redundant expressions across abnormal edges.
  6554. 2003-09-13 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  6555. * tree-cfg.c (remove_unreachable_blocks): Clean up.
  6556. (debug_tree_bb_n): New.
  6557. (is_ctrl_structure): Remove LOOP_EXPR.
  6558. * tree-flow.h (debug_tree_bb_n): Declare.
  6559. 2003-09-12 Andrew Macleod <amacleod@redhat.com>
  6560. * tree-ssa-live.c (calculate_live_on_entry): Use default_def to add
  6561. addition checks to live on entry calculations.
  6562. * tree-ssa.c (print_exprs_edge): New debug output function.
  6563. (coalesce_abnormal_edges): Add basic block information to output.
  6564. (coalesce_ssa_name): Use default_def instead of trying to compute live
  6565. on entry variables.
  6566. 2003-09-12 Diego Novillo <dnovillo@redhat.com>
  6567. * tree-optimize.c (tree_rest_of_compilation): Set TREE_ASM_WRITTEN
  6568. for functions that have errors.
  6569. 2003-09-12 Diego Novillo <dnovillo@redhat.com>
  6570. * tree-ssa-pre.c (graph_dump_file, graph_dump_flags): Remove
  6571. unused variables.
  6572. 2003-09-11 Daniel Berlin <dberlin@dberlin.org>
  6573. * tree-ssa-pre.c (reset_down_safe): Make test less conservative.
  6574. (cba_search_start_from): Start from abnormal edge arguments, too.
  6575. (cba_search_continue_from_to): Ditto here.
  6576. 2003-09-11 Daniel Berlin <dberlin@dberlin.org>
  6577. * tree-ssa-pre.c: s/#if ENABLE_CHECKING/#ifdef ENABLE_CHECKING/g.
  6578. Add more comments to DFS searching functions.
  6579. (cba_search_reach_from_to): Remove empty function.
  6580. (code_motion): Remove #if 0'd code.
  6581. (pre_expression): Ditto.
  6582. * tree.h (tree_dump_index): Remove TDI_predot.
  6583. * tree-dump.c (dump_files): Ditto.
  6584. 2003-09-11 Jason Merrill <jason@redhat.com>
  6585. Make EDGE_FALLTHRU meaningful for tree-cfg.
  6586. * tree-cfg.c (make_edges): Set EDGE_FALLTHRU on fallthrough edge.
  6587. (make_exit_edges): Likewise.
  6588. (make_ctrl_stmt_edges): Don't set EDGE_FALLTHRU on edges into a
  6589. control structure.
  6590. (handle_switch_fallthru): Clear EDGE_FALLTHRU after inserting a goto.
  6591. (find_insert_location): Only insert after a CALL_EXPR or MODIFY_EXPR.
  6592. (bsi_insert_on_edge_immediate): Count outgoing abnormal edges.
  6593. Insert before all control stmts.
  6594. (bsi_link_after): Handle a block with nops after the last stmt.
  6595. Rename some things to clarify difference between "control structures"
  6596. (i.e. COND_EXPR) and "control statements" (also GOTO_EXPR).
  6597. * basic-block.h (BB_CONTROL_STRUCTURE): Rename from BB_CONTROL_EXPR.
  6598. * tree-cfg.c (REMOVE_NON_CONTROL_STRUCTS): Rename from
  6599. REMOVE_NON_CONTROL_STMTS.
  6600. (REMOVE_CONTROL_STRUCTS): Rename from REMOVE_CONTROL_STMTS.
  6601. (make_ctrl_stmt_edges): Move GOTO_EXPR/RETURN_EXPR handling here...
  6602. (make_exit_edges): ...from here.
  6603. (is_ctrl_altering_stmt): Don't accept GOTO_EXPR/RETURN_EXPR.
  6604. (is_ctrl_structure): Renamed from old is_ctrl_stmt.
  6605. (is_ctrl_stmt): New fn.
  6606. (bsi_move_to_bb_end): Use it.
  6607. (stmt_starts_bb_p): Use is_ctrl_stmt and is_ctrl_altering_stmt.
  6608. * tree-flow.h: Add prototype.
  6609. * tree-ssa-ccp.c, tree-ssa-dom.c: Update for name changes.
  6610. 2003-09-10 Daniel Berlin <dberlin@dberlin.org>
  6611. * tree-ssa-pre.c (ephi_has_bottom): Remove dead function.
  6612. (ephi_has_unsafe_arg): New function.
  6613. (compute_down_safety): Use it.
  6614. (reset_down_safe): Continue search on abnormal edges, too.
  6615. 2003-09-10 Jason Merrill <jason@redhat.com>
  6616. * gimplify.c (gimplify_asm_expr): Add post_p parm.
  6617. (get_initialized_tmp_var): Add post_p parm.
  6618. (internal_get_tmp_var): Likewise.
  6619. (gimplify_expr, get_formal_tmp_var): Pass it.
  6620. * c-simplify.c (gimplify_decl_stmt): Pass it.
  6621. * tree-simple.h: Adjust prototype.
  6622. * tree-cfg.c (make_call_expr_edges): Break out from...
  6623. (make_exit_edges): ...here. Check TREE_NOTHROW.
  6624. (is_ctrl_altering_stmt): Check TREE_NOTHROW.
  6625. 2003-09-10 Paul Brook <paul@nowt.org>
  6626. * gimplify.c (gimplify_compound_lval): Treat REALPART_EXPR and
  6627. IMAGPART_EXPR the same as COMPONENT_REF.
  6628. * tree-simple.c (is_gimple_addr_expr_arg): Ditto.
  6629. (is_gimple_lvalue): Remove REALPART_EXPR and IMAGPART_EXPR.
  6630. 2003-09-10 Diego Novillo <dnovillo@redhat.com>
  6631. * c-pretty-print.c (decl_name_str): New local function.
  6632. (pp_c_direct_declarator): Call it.
  6633. (pp_c_primary_expression): Call it.
  6634. (pp_c_id_expression): Call it.
  6635. (pp_c_statement): Call it.
  6636. 2003-09-10 Diego Novillo <dnovillo@redhat.com>
  6637. * tree-pretty-print.c (dump_generic_node): Change string used to
  6638. display _DECL nodes with no DECL_NAME.
  6639. 2003-09-10 Diego Novillo <dnovillo@redhat.com>
  6640. * tree-dfa.c (add_referenced_var): Handle cases when argument
  6641. walk_state is NULL.
  6642. (add_referenced_tmp_var): New function.
  6643. * tree-flow.h (add_referenced_tmp_var): Declare it.
  6644. * tree-ssa-pre.c (pre_expression): Call it.
  6645. * tree-ssa-live.c (create_ssa_var_map): Add checking for variables
  6646. being in real and virtual operands.
  6647. 2003-09-01 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  6648. Jeff Law <law@redhat.com>
  6649. * tree-flow.h (remove_unreachable_blocks): Declare.
  6650. * tree-cfg.c (remove_unreachable_blocks): Export. Return true
  6651. if blocks were removed.
  6652. * tree-ssa-dom.c (optimize_block, optimize_stmt): Record whether
  6653. the cfg has changed. Schedule jump threading. If a block
  6654. has more than one pred, then do not record equivalences created
  6655. by a controlling COND_EXPR.
  6656. (edges_to_redirect, redirection_targets): New variables.
  6657. (thread_edge): Split out of optimize_block.
  6658. (tree_ssa_dominator_optimize); Remove unreachable blocks and
  6659. recompute dominator tree when the cfg changes.
  6660. 2003-09-07 Steven Bosscher <steven@gcc.gnu.org>
  6661. * c-tree.h: Don't declare c_genericize, it's already
  6662. declared in c-common.h.
  6663. 2003-09-07 Steven Bosscher <steven@gcc.gnu.org>
  6664. Fix PR optimization/12198
  6665. * tree-cfg.c (value_matches_some_label): Handle integer
  6666. case ranges.
  6667. 2003-09-06 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  6668. * tree-iterator.h (tsi_iterator_update): Added TSI_CHAIN_START,
  6669. TSI_CHAIN_END, TSI_CONTINUE_LINKING and comments.
  6670. (tsi_link_chain_before, tsi_link_chain_after): Declare.
  6671. * tree.c (tsi_link_chain_before, tsi_link_chain_after): New.
  6672. (tsi_link_before, tsi_link_after): Handle new TSI_...
  6673. positions.
  6674. 2003-09-06 Diego Novillo <dnovillo@redhat.com>
  6675. * varray.c (element): Add entry for 'tree *'.
  6676. * varray.h (enum varray_data_enum): Add VARRAY_DATA_TREE_PTR.
  6677. (union varray_data_tag): Add entry for 'tree *'.
  6678. (VARRAY_TREE_PTR_INIT): Define.
  6679. (VARRAY_TREE_PTR): Define.
  6680. (VARRAY_PUSH_TREE_PTR): Define.
  6681. (VARRAY_TOP_TREE_PTR): Define.
  6682. * tree-cfg.c: Replace uses of VARRAY_GENERIC_PTR with
  6683. VARRAY_TREE_PTR when accessing operand arrays.
  6684. * tree-ssa-ccp.c: Likewise.
  6685. * tree-ssa-copyprop.c: Likewise.
  6686. * tree-ssa-dce.c: Likewise.
  6687. * tree-ssa-dom.c: Likewise.
  6688. * tree-ssa-live.c: Likewise.
  6689. * tree-ssa-pre.c: Likewise.
  6690. * tree-dfa.c: Likewise.
  6691. * tree-ssa.c: Likewise.
  6692. * tree-flow.h (struct operands_d): Remove 'skip' GC markers from
  6693. all fields.
  6694. (struct dataflow_d): Likewise.
  6695. 2003-09-05 Diego Novillo <dnovillo@redhat.com>
  6696. * tree-dfa.c (find_referenced_vars): Re-enable .GLOBAL_VAR
  6697. optimization.
  6698. 2003-09-05 Daniel Berlin <dberlin@dberlin.org>
  6699. * tree.h (tree_eref_common): Make stmt a tree, not a tree *.
  6700. * tree-ssa-pre.c: Transform all tree *'s to tree.
  6701. 2003-09-05 Paul Brook <paul@nowt.org>
  6702. * tree.h (enum tree_index): Delete TI_SIGNED_SIZE_TYPE here.
  6703. (signed_size_type_node): No longer a member of global_trees.
  6704. * c-common.h (enum c_tree_index): New member CTI_SIGNED_SIZE_TYPE.
  6705. (signed_size_type_node): Moved, now a member of c_global_trees.
  6706. 2003-09-05 Diego Novillo <dnovillo@redhat.com>
  6707. * tree-dfa.c (find_referenced_vars): Temporarily disable
  6708. .GLOBAL_VAR optimization.
  6709. 2003-09-04 Daniel Berlin <dberlin@dberlin.org>
  6710. * tree-alias-common.c: Add overview.
  6711. * tree-alias-ander.c: Add overview and more specific comments on what
  6712. each function does.
  6713. 2003-09-04 Diego Novillo <dnovillo@redhat.com>
  6714. * tree-optimize.c (tree_rest_of_compilation): Return if errorcount
  6715. or sorrycount are non-zero.
  6716. 2003-09-04 Diego Novillo <dnovillo@redhat.com>
  6717. * tree-cfg.c (cleanup_tree_cfg): Traverse basic blocks
  6718. with FOR_EACH_BB.
  6719. (remove_useless_stmts_and_vars): Likewise.
  6720. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise.
  6721. * tree-ssa.c (rewrite_into_ssa): Likewise.
  6722. * tree-dfa.c (remove_all_phi_nodes_for): Make sure that the new
  6723. list of PHI nodes is NULL-terminated.
  6724. Add sanity checks to make sure all the PHI nodes for variables to
  6725. rename are gone.
  6726. 2003-09-04 Diego Novillo <dnovillo@redhat.com>
  6727. * tree-dfa.c (struct walk_state): Add field 'num_calls'.
  6728. (add_call_clobber_ops): New local function.
  6729. (add_call_read_ops): New local function.
  6730. (get_expr_operands): Call them.
  6731. (add_stmt_operand): Call-clobbered variables are always added to
  6732. virtual operands.
  6733. (find_referenced_vars): If the number of call-clobbered variables
  6734. and number of call sites is larger than a certain threshold, group
  6735. all call-clobbered variables under .GLOBAL_VAR.
  6736. (find_vars_r): Count the number of call sites.
  6737. Don't add .GLOBAL_VAR to the list of referenced variables.
  6738. (add_referenced_var): If the addressable variable is an array,
  6739. register alias set of the type of the elements, not the type of the
  6740. array.
  6741. * tree-ssa-dom.c (mark_new_vars_to_rename): Rename from
  6742. find_new_vars_to_rename. Update all users.
  6743. Before scanning the statement for new operands, mark the existing
  6744. virtual operands to be renamed again.
  6745. (optimize_stmt): Also check for newly exposed variables when doing
  6746. redundancy elimination.
  6747. * tree-ssa.c (rewrite_into_ssa): Don't abort when rename_count is
  6748. greater than 2. Simply stop trying at 3.
  6749. (prepare_operand_for_rename): New function.
  6750. (mark_def_sites): Call it.
  6751. (rewrite_stmt): Don't check if the operand is an SSA_NAME before
  6752. calling rewrite_operand.
  6753. (rewrite_operand): Don't abort if the operand was already an
  6754. SSA_NAME. Ignore it.
  6755. 2003-09-03 Richard Henderson <rth@redhat.com>
  6756. * tree-optimize.c (set_save_expr_context, clear_decl_rtl,
  6757. tree_rest_of_compilation): Merge from mainline new file.
  6758. * Makefile.in (tree-optimize.o): Update.
  6759. * c-semantics.c (expand_stmt_toplev): New.
  6760. * c-common.h (expand_stmt_toplev): Declare.
  6761. * c-lang.c, objc/objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): Use it.
  6762. 2003-09-03 Richard Henderson <rth@redhat.com>
  6763. * gimplify.c (gimplify_switch_expr): Leave the outermost cast
  6764. as part of the switch condition.
  6765. 2003-09-02 Diego Novillo <dnovillo@redhat.com>
  6766. * Makefile.in (tree.o): Add dependency on $(BASIC_BLOCK_H) and
  6767. $(TREE_FLOW_H)
  6768. * tree.c: Include basic-block.h and tree-flow.h
  6769. (tsi_link_after): Adjust basic block tree pointers when inserting a
  6770. new COMPOUND_EXPR.
  6771. 2003-09-02 Richard Henderson <rth@redhat.com>
  6772. * c-decl.c (finish_function): Fix misapplied patch. Don't
  6773. free_after_parsing or free_after_compilation. For real this time.
  6774. 2003-09-01 Daniel Berlin <dberlin@dberlin.org>
  6775. * tree-ssa-pre.c (finalize_1): Remove unnecessary call to
  6776. insert_euse_in_preorder_dt_order.
  6777. (code_motion): Ditto.
  6778. (pre_expression): Ditto.
  6779. 2003-09-01 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  6780. Jeff Law <law@redhat.com>
  6781. * basic-block.h (BB_LOOP_CONTROL_EXPR): Remove.
  6782. * c-simplify.c (gimplify_c_loop): Create loops in a better shape.
  6783. * cfgloop.h (create_loop_notes): Declare.
  6784. * cfgloopmanip.c (create_loop_notes): New.
  6785. * explow.c (probe_stack_range): Don't produce loop notes when we
  6786. recreate them.
  6787. * expr.c (emit_block_move_via_loop): Ditto.
  6788. * gimplify.c (build_and_jump): Export.
  6789. (gimplify_loop_expr): Don't produce LOOP_EXPRs.
  6790. * toplev.c (rest_of_compilation): Recreate loop notes if needed.
  6791. * tree-cfg.c (make_loop_expr_edges, make_loop_expr_blocks): Removed.
  6792. (find_contained_blocks, make_ctrl_stmt_edges,
  6793. remove_useless_stmts_and_vars, stmt_ends_bb_p, bsi_insert_before,
  6794. find_insert_location, bsi_insert_on_edge_immediate,
  6795. merge_tree_blocks): Remove handling of LOOP_EXPRs.
  6796. (remove_stmt): Remove handling of BB_LOOP_CONTROL_EXPR.
  6797. (find_taken_edge): Remove comment on LOOP_EXPRs.
  6798. (dump_tree_bb): Don't dump loop-related information.
  6799. (is_loop_stmt, is_latch_block_for): Removed.
  6800. (find_insert_location): Handle TRY_CATCH and TRY_FINALLY.
  6801. * tree-flow.h (is_loop_stmt, loop_body, set_loop_body,
  6802. is_latch_block_for): Removed.
  6803. * tree-dfa.c (get_stmt_operands): Don't handle LOOP_EXPRs.
  6804. * tree-simple.c (is_gimple_stmt): Remove handling of LOOP_EXPRs.
  6805. * tree-simple.h: Remove LOOP_EXPRs from gimple grammar comment.
  6806. (build_and_jump): Declare.
  6807. * tree-ssa.c (remove_annotations_r): Don't handle LOOP_EXPRs.
  6808. 2003-08-29 Daniel Berlin <dberlin@dberlin.org>
  6809. * opts.c (decode_options): Turn on SSAPRE by default.
  6810. 2003-08-29 Jason Merrill <jason@redhat.com>
  6811. * builtins.c (simplify_builtin): Make sure that the replacement
  6812. has the same type as the original expression.
  6813. (simplify_builtin_strpbrk): Fix type of COMPOUND_EXPR.
  6814. (simplify_builtin_strncpy, simplify_builtin_memcmp): Likewise.
  6815. (simplify_builtin_strncmp, simplify_builtin_strncat): Likewise.
  6816. (simplify_builtin_strspn, simplify_builtin_strcspn): Likewise.
  6817. (simplify_builtin_fputs, simplify_builtin_sprintf): Likewise.
  6818. 2003-08-28 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  6819. * builtins.c (expand_builtin): Expand BUILT_IN_STACK_SAVE and
  6820. BUILT_IN_STACK_RESTORE.
  6821. * builtins.def (BUILT_IN_STACK_SAVE, BUILT_IN_STACK_RESTORE): New.
  6822. * gimplify.c (build_stack_save_restore): New functions.
  6823. (struct gimplify_ctx): New field save_stack.
  6824. (gimplify_bind_expr, gimplify_call_expr): Arrange save of stack on
  6825. BIND_EXPR entry and restore on exits.
  6826. * stmt.c (expand_stack_alloc): Saving of stack removed.
  6827. (expand_stack_save, expand_stack_restore): New.
  6828. * tree.h (expand_stack_save, expand_stack_restore): Declare.
  6829. 2003-08-28 Diego Novillo <dnovillo@redhat.com>
  6830. * tree-dfa.c (add_vdef): Check for duplicate voperands first.
  6831. Handle SSA_NAME in voperands.
  6832. (add_vuse): Likewise.
  6833. 2003-08-27 Diego Novillo <dnovillo@redhat.com>
  6834. * tree-flow.h (var_ann_d): Convert is_in_va_arg_expr into a
  6835. bitfield.
  6836. 2003-08-27 Daniel Berlin <dberlin@dberlin.org>
  6837. * tree-ssa-pre.c: Update comments to reflect reality.
  6838. (insert_one_operand): Remove #if'0d code.
  6839. 2003-08-27 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  6840. * gcov.c (typedef struct arc_info): New field cs_count.
  6841. (accumulate_line_counts): Find cycles correctly.
  6842. 2003-08-27 Daniel Berlin <dberlin@dberlin.org>
  6843. * tree-ssa-pre.c (compute_du_info): Move #if ENABLE_CHECKING up one
  6844. line.
  6845. 2003-08-27 Daniel Berlin <dberlin@dberlin.org>
  6846. * tree.h (struct ephi_arg_d): New structure.
  6847. (struct eref_common): Remove non-used members, move some members
  6848. elsewhere.
  6849. (struct ephi_node): Ditto.
  6850. * tree-optimize.c (optimize_function_tree): Move PRE before DCE.
  6851. * tree.c (tree_size): use sizeof (struct ephi_arg_d) for ephi's.
  6852. * tree-pretty-print.c (dump_generic_node): Re-teach to pretty
  6853. print euses/ephis/etc given new structures, members, and
  6854. relationships.
  6855. * tree-ssa-pre.c (fixup_domchildren): Removed.
  6856. (a_dom_b): Ditto.
  6857. (calculate_preorder): Ditto.
  6858. (defs_match_p): Ditto.
  6859. (defs_y_dom_x): Ditto.
  6860. (compute_can_be_avail): Ditto.
  6861. (reset_can_be_avail): Ditto.
  6862. (reset_later): Ditto.
  6863. (compute_later): Ditto.
  6864. (repair_*): Ditto.
  6865. (set_replacement): Ditto.
  6866. (remove_ephi): Ditto.
  6867. (set_expruse_def): Ditto.
  6868. (occ_compare): Ditto.
  6869. (defs_hash_expr): Ditto.
  6870. (compute_dt_preorder): Ditto
  6871. (search_dt_preorder): Ditto.
  6872. (ephi_operand_for_pred): Ditto.
  6873. (injured_ephi_operand): Ditto.
  6874. (compute_stops): New function.
  6875. (occ_identical_to): Ditto.
  6876. (require_phi): Ditto.
  6877. (do_ephi_df_search_1): Ditto.
  6878. (do_ephi_df_search): Ditto.
  6879. (any_operand_injured): Ditto.
  6880. (compute_du_info): Ditto.
  6881. (add_ephi_use): Ditto.
  6882. (insert_one_operand): Ditto.
  6883. (add_ephi_pred): Ditto.
  6884. (created_phi_preds): New bitmap.
  6885. (dfn) Removed static variable.
  6886. (idom_of_ephi): Ditto.
  6887. (avdefs): Move into expr_info).
  6888. (struct ephi_use_entry): New structure for EPHI uses.
  6889. (struct ephi_df_search): New structure for depth first searchs.
  6890. (cant_be_avail_search): Implementation of structure for
  6891. cant_be_avail search.
  6892. (stops_search): Ditto for stops.
  6893. (replacing_search): Ditto for replacing_search.
  6894. (do_proper_save): Arguments changed, callers updated.
  6895. (create_ephi_node): Use sizeof (struct ephi_arg_d).
  6896. (ephi_has_bottom): Rewrite for updated ephi-pred handling.
  6897. (ephi_will_be_avail): Rewrite in terms of CANT_BE_AVAIL and STOPS.
  6898. (expr_phi_insertion): Remove dead code.
  6899. Update for new flags.
  6900. (insert_occ_in_preorder_dt_order_1): Only insert one ephi-pred per
  6901. block.
  6902. Fix exit occurence handling.
  6903. (rename_1): Remove occs stuff.
  6904. Update for new ephi-pred handling.
  6905. (reset_down_safe): Update for new ephi-pred handling.
  6906. (compute_down_safe): Ditto.
  6907. (can_insert): Ditto.
  6908. (insert_one_operand): Split out from finalize_1.
  6909. (finalize_1): Update for new ephi-pred handling.
  6910. Only insert non-pointless, will-be-avail phis, rather than *all*
  6911. ephis.
  6912. (get_temp): New function. Hand us the right temporary for a given
  6913. EPHI/EUSE.
  6914. (code_motion): Use EREF_TEMP again, now that we can do it
  6915. properly.
  6916. 2003-08-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  6917. * builtins.c (expand_builtin): Handle STACK_ALLOC.
  6918. * builtins.def (BUILT_IN_STACK_ALLOC): New.
  6919. * c-simplify.c (gimplify_decl_stmt, c_gimplify_stmt,
  6920. gimplify_compound_literal_expr): Arrange explicit stack allocation.
  6921. * expr.c (expand_expr): Handle deferred variables.
  6922. * stmt.c (expand_stack_alloc): New.
  6923. * tree-simple.c (is_gimple_val): Prevent ADDR_EXPRs of vla's from
  6924. being reduced.
  6925. * tree.h (expand_stack_alloc): Declare.
  6926. 2003-08-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  6927. * tree-ssa.c (build_dominator_tree): Use FOR_EACH_BB.
  6928. 2003-08-26 Jason Merrill <jason@redhat.com>
  6929. * tree-simple.c (is_gimple_val): Also disallow memory vars.
  6930. 2003-08-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  6931. * integrate.c (copy_decl_for_inlining): Reset DECL_TOO_LATE.
  6932. 2003-08-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  6933. * tree-ssa-dom.c (optimize_block): Handle empty source block.
  6934. * tree-ssa-dom.c (optimize_block): Handle case when dominance
  6935. tree children have also other sucessors. Add dump to jump
  6936. threading.
  6937. 2003-08-25 Jason Merrill <jason@redhat.com>
  6938. * c-simplify.c (mark_labels_r): New fn.
  6939. (gimplify_decl_stmt): Use it to mark labels in static initializers.
  6940. * tree-simple.c (is_gimple_initializer): Remove.
  6941. (is_gimple_reg_type): New fn.
  6942. (is_gimple_reg): Use it. Handle SSA_NAMEs properly.
  6943. * tree-simple.h: Adjust.
  6944. * gimplify.c (gimplify_expr) <CONSTRUCTOR>: Do nothing here.
  6945. * gimplify.c (create_tmp_var): Set DECL_IGNORED_P.
  6946. * tree-inline.c (initialize_inlined_parameters): Improve error
  6947. recovery.
  6948. * gimplify.c (gimplify_boolean_expr): Just replace with a COND_EXPR.
  6949. 2003-08-25 Diego Novillo <dnovillo@redhat.com>
  6950. * tree-dfa.c (get_expr_operands): Don't create shared operands when
  6951. folding *&VAR expressions.
  6952. 2003-08-24 Diego Novillo <dnovillo@redhat.com>
  6953. * tree-flow.h (struct var_ann_d): Add field default_def.
  6954. (widen_bitfield): Declare.
  6955. (set_default_def): Declare.
  6956. (default_def): Declare.
  6957. * tree-flow-inline.h (set_default_def): New inline function.
  6958. (default_def): New inline function.
  6959. * tree-dfa.c (dump_variable): Display default_def, if set.
  6960. * tree-simple.c (is_gimple_reg): Check for DECL_P before checking
  6961. for DECL_EXTERNAL.
  6962. * tree-ssa-dom.c (add_expr_propagated_p): Remove. Update all
  6963. users.
  6964. (find_new_vars_to_rename): New local function.
  6965. (tree_ssa_dominator_optimize): Add new argument vars_to_rename.
  6966. Change return type to void. Update all users.
  6967. (optimize_block): Add new argument vars_to_rename. Update all
  6968. users.
  6969. If the call to optimize_stmt returns true, add the statement to the
  6970. list of statements to re-scan for operands.
  6971. After optimizing the block and its dominator children, call
  6972. find_new_vars_to_rename for every statement that may have had new
  6973. symbols exposed.
  6974. (optimize_stmt): Change return type to bool. Return true if the
  6975. statement may have had new symbols exposed by optimization.
  6976. Add a sanity check for the value returned by lookup_avail_expr.
  6977. Create equivalences for more memory stores, not just the ones done
  6978. via INDIRECT_REF expressions.
  6979. Call widen_bitfield when optimizing stores to bitfields.
  6980. (lookup_avail_expr): Reformat comment.
  6981. * tree-ssa.c (rewrite_into_ssa): Remove local variable
  6982. addr_expr_propagated_p.
  6983. Clear out vars_to_rename before running dominator optimizations.
  6984. (check_for_new_variables): Remove.
  6985. (rewrite_stmt): Always register new definitions and virtual
  6986. definitions.
  6987. (register_new_def): Update comment.
  6988. (get_reaching_def): Update the default_def field for the variable
  6989. if it didn't have a reaching definition.
  6990. * tree-ssa-ccp.c (widen_bitfield): Declare it extern.
  6991. 2003-08-23 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  6992. * tree-cfg.c (bsi_next_in_bb): Work correctly when the block ends
  6993. with start of BIND_EXPR.
  6994. 2003-08-23 Daniel Berlin <dberlin@dberlin.org>
  6995. * tree-alias-ander.c (andersen_op_assign): Fix to join the operands,
  6996. the assign to the lhs.
  6997. 2003-08-23 Daniel Berlin <dberlin@dberlin.org>
  6998. * tree-alias-common.c (get_alias_var): Remove REFERENCE_EXPR.
  6999. (find_func_aliases): Fix some not quite right predicates, add ARRAY_REF
  7000. handling.
  7001. 2003-08-22 Jeff Law <law@redhat.com>
  7002. * tree-dfa.c (compute_alias_sets): A memory tag used for stores can
  7003. not conflict with objects marked TREE_READONLY.
  7004. * tree-ssa-ccp.c (fold_stmt): Optimize reads from constant strings.
  7005. 2003-08-22 Jason Merrill <jason@redhat.com>
  7006. * tree-simple.c: Total overhaul to only check forms and remove
  7007. unnecessary predicates.
  7008. (is_gimple_const): Accept function addresses here.
  7009. Don't accept LABEL_DECL or RESULT_DECL.
  7010. (is_gimple_val): Accept EXC_PTR_EXPR here.
  7011. (is_gimple_lvalue): Rename from is_gimple_modify_expr_lhs.
  7012. Accept BIT_FIELD_REF, REALPART_EXPR and IMAGPART_EXPR here.
  7013. (is_gimple_addr_expr_arg): Replace with former is_gimple_varname.
  7014. (is_gimple_constructor_elt): Just check for CONSTRUCTOR.
  7015. (is_gimple_initializer): Just hand off to is_gimple_rhs.
  7016. (is_gimple_rhs): Recognize most expressions here.
  7017. (is_gimple_variable): New fn.
  7018. (is_gimple_id): Use it. Now static.
  7019. (is_gimple_reg): New fn.
  7020. (is_gimple_cast): Replace with former is_gimple_cast_op.
  7021. (is_gimple_constructor, is_gimple_expr): Remove.
  7022. (is_gimple_modify_expr, is_gimple_relop): Remove.
  7023. (is_gimple_binary_expr, is_gimple_unary_expr): Remove.
  7024. (is_gimple_call_expr, is_gimple_arglist): Remove.
  7025. (is_gimple_compound_lval, is_gimple_arrayref): Remove.
  7026. (is_gimple_compref, is_gimple_exprseq): Remove.
  7027. (is_gimplifiable_builtin): Remove.
  7028. * tree-simple.h: Adjust.
  7029. * gimplify.c (gimplify_conversion): Break out from gimplify_expr.
  7030. (gimplify_expr): Use is_gimple_reg predicate to force a temp.
  7031. <COMPONENT_REF>: Use gimplify_compound_lval.
  7032. <REALPART_EXPR, IMAGPART_EXPR>: Likewise.
  7033. <INDIRECT_REF>: Use is_gimple_reg predicate.
  7034. <MIN_EXPR, MAX_EXPR>: Use new gimplify_minimax_expr.
  7035. <TREE_LIST>: Reject.
  7036. (gimplify_tree_list, gimplify_component_ref): Remove.
  7037. (gimplify_compound_lval): Include REALPART_EXPR and IMAGPART_EXPR.
  7038. (gimplify_component_ref): Remove.
  7039. (gimplify_call_expr): Handle non-gimplifiable builtins and walking
  7040. the argument list here.
  7041. (gimplify_tree_list): Remove.
  7042. (gimplify_addr_expr): Use fb_either.
  7043. * tree-simple.h: Adjust.
  7044. * tree-alias-common.c (find_func_aliases): Update use of predicates.
  7045. 2003-08-21 Andrew Pinski <pinskia@physics.uc.edu>
  7046. * tree-ssa.c (tree_ssa_useless_type_conversion): Check also the
  7047. precision of the type to make sure they are really useless type
  7048. conversions.
  7049. 2003-08-21 Diego Novillo <dnovillo@redhat.com>
  7050. * tree-dump.c (dequeue_and_dump): Handle 'r' and 's' code classes.
  7051. 2003-08-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  7052. * c-pretty-print.c (print_c_tree): Create new pp object.
  7053. 2003-08-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  7054. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Don't free hash tables
  7055. before statistics are made from them.
  7056. * tree-ssa.c (rewrite_into_ssa): Ditto.
  7057. 2003-08-21 Jason Merrill <jason@redhat.com>
  7058. * tree-inline.c (copy_body_r): Don't convert when stripping &*.
  7059. Fix thinko in stripping *&.
  7060. 2003-08-21 Diego Novillo <dnovillo@redhat.com>
  7061. Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  7062. * tree-cfg.c (stmt_starts_bb_p): Nonlocal and computed GOTO targets
  7063. always start a new block.
  7064. 2003-08-20 Jason Merrill <jason@redhat.com>
  7065. * tree-pretty-print.c (dump_generic_node): Just print "<retval>"
  7066. for the RESULT_DECL.
  7067. * c-simplify.c (make_type_writable, mostly_copy_tree_r): Remove.
  7068. (deep_copy_list, deep_copy_node): Remove.
  7069. * expr.c (expand_expr): Don't check for 'r' or 's' if we're
  7070. checking IS_EXPR_CODE_CLASS.
  7071. * tree-dfa.c (may_access_global_mem_p): Likewise.
  7072. * tree-browser.c (browse_tree): Likewise.
  7073. * tree-ssa-pre.c (defs_hash_expr): Likewise.
  7074. * gimplify.c (gimplify_expr): Likewise.
  7075. (internal_get_tmp_var): Only copy TREE_LOCUS from an expr.
  7076. (mostly_copy_tree_r): Ignore decls here.
  7077. 2003-08-20 Diego Novillo <dnovillo@redhat.com>
  7078. * c-pretty-print.c: Discard. Replace with same file from
  7079. mainline. Update all users.
  7080. (print_c_tree): New function.
  7081. * c-pretty-print.h (print_c_tree): Declare.
  7082. * tree-pretty-print.c: Update to use new pp_* primitives.
  7083. * c-simplify.c: Include c-pretty-print.h.
  7084. * Makefile.in (c-simplify.o): Add dependency on $(C_PRETTY_PRINT_H).
  7085. 2003-08-20 Roger Sayle <roger@eyesopen.com>
  7086. * c-common.h (enum c_tree_index): Delete CTI_SIGNED_SIZE_TYPE.
  7087. (signed_size_type_node): No longer a member of c_global_trees.
  7088. * tree.h (enum tree_index): New member TI_SIGNED_SIZE_TYPE here.
  7089. (signed_size_type_node): Moved, now a member of global_trees.
  7090. 2003-08-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  7091. * tree-ssa-dom.c (optimize_block): Thread jump into empty
  7092. block correctly.
  7093. * tree-cfg.c (linearize_cond_expr): Don't merge blocks if the
  7094. later has other predecessors.
  7095. 2003-08-19 Jason Merrill <jason@redhat.com>
  7096. * c-typeck.c (build_array_ref): Also build ARRAY_REFs from
  7097. INDIRECT_REFs of ARRAY_TYPE.
  7098. * tree-ssa.c (tree_ssa_useless_type_conversion): Also strip
  7099. conversions between pointer and reference types.
  7100. * tree-dfa.c (get_stmt_operands): Just mark non-GIMPLE statements
  7101. as unmodified.
  7102. (find_referenced_vars): So we don't need to mark them here.
  7103. * tree-inline.c (inline_data): Add retvar field.
  7104. (declare_return_variable): Set it.
  7105. (remap_decls): Use it.
  7106. (expand_call_inline): Tweak.
  7107. 2003-08-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  7108. * cfg.c (dump_edge_info): Add name for EDGE_LOOP_EXIT flag.
  7109. 2003-08-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  7110. * tree-flow.h (struct var_ann_d): New field scope.
  7111. (struct stmt_ann_d): New field scope.
  7112. (propagate_copy): Declaration changed.
  7113. (fixup_var_scope): Declare.
  7114. * tree-cfg.c (make_blocks, make_cond_expr_blocks,
  7115. make_catch_expr_blocks, make_eh_filter_expr_blocks,
  7116. make_try_expr_blocks, make_loop_expr_blocks, make_switch_expr_blocks,
  7117. make_bind_expr_blocks, build_tree_cfg): Assign variables and statements
  7118. to scopes.
  7119. (assign_vars_to_scope): New.
  7120. * tree-ssa-copyprop.c (move_var_to_scope): New.
  7121. (copyprop_stmt): Pass scope of statement to propagate_copy.
  7122. (propagate_copy): Assign variable to the right bind_expr.
  7123. (fixup_var_scope): New.
  7124. * tree-ssa-dom.c (optimize_stmt): Pass scope of statement to
  7125. propagate_copy.
  7126. 2003-08-19 Daniel Berlin <dberlin@dberlin.org>
  7127. * tree-cfg (bsi_move_after): New function.
  7128. (bsi_move_before): New function.
  7129. (bsi_move_to_bb_end): New function.
  7130. * tree-flow.h: Prototype new functions.
  7131. 2003-08-18 Daniel Berlin <dberlin@dberlin.org>
  7132. * tree-alias-ander.c: Remove doxygen markers.
  7133. (eq_to_var): remove.
  7134. (simple_cmp): Add.
  7135. (throwaway_global): Add.
  7136. (andersen_same_points_to_set): Handle ignoring global var aliasing the
  7137. right way here.
  7138. (andersen_may_alias): Use list_member to avoid stupid hack.
  7139. * tree-alias-common.c: Remove hacks for disabling global var aliasing.
  7140. 2003-08-17 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  7141. * tree.c (resize_phi_node): Initialize new entries.
  7142. 2003-08-17 Jeff Law <law@redhat.com>
  7143. * tree-pretty-print.c (last_bb): Actually record the basic block,
  7144. not just its index.
  7145. (maybe_init_pretty_print): Corresponding changes.
  7146. (dump_generic_node, dump_vops): Test the actual block pointers, not
  7147. their indices.
  7148. * tree-ssa-dom.c (optimize_block): Use equivalences from the
  7149. dominator tree walk to thread through conditional jumps at leafs in
  7150. the dominator tree.
  7151. * tree-cfg.c (blocks_unreachable_p, remove_blocks): Use a bitmap
  7152. rather than a varray.
  7153. (REMOVE_ALL_STMTS, REMOVE_NO_STMTS): New defines for remove_bb.
  7154. (REMOVE_NON_CONTROL_STMTS, REMOVE_CONTROL_STMTS): Likewise.
  7155. (remove_unreachable_block): Use find_contained_blocks rather
  7156. than find_subblocks. If we have a COND_EXPR or SWITCH_EXPR which
  7157. is unreachable, but which has reachable children clear out the
  7158. condition and request all non-control statements be removed
  7159. from the block.
  7160. (remove_bb): Allow better control over what (if any) statements
  7161. are removed. All callers updated.
  7162. (find_subblocks): Remove.
  7163. (find_contained_blocks): Handle statements with no associated
  7164. basic block.
  7165. 2003-08-15 Andrew Pinski <pinskia@physics.uc.edu>
  7166. * objc/objc-lang.c (LANG_HOOKS_GIMPLIFY_EXPR): Define
  7167. as the c gimplifier.
  7168. 2003-08-15 Jeff Law <law@redhat.com>
  7169. * tree-cfg.c (cleanup_tree_cfg): Wipe out the dominator tree
  7170. if the number of basic blocks changes as a result of cfg cleanups.
  7171. * tree-flow.h (build_dominator_tree): Prototype.
  7172. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Build the dominator
  7173. tree if it is not already available.
  7174. * tree-ssa.c (build_dominator_tree): New function.
  7175. (rewrite_into_ssa): Use it.
  7176. * gimplify.c (gimplify_expr, cases NOP_EXPR, CONVERT_EXPR): If a
  7177. COMPONENT_REF is wrapped with a NOP_EXPR, then force the type of
  7178. the COMPONENT_REF to match the accessed field. Strip away
  7179. unnecessary type conversions and handle the case where all type
  7180. conversions were removed.
  7181. (case ARRAY_REF, COMPONENT_REF): Indicate to gimplify_array_ref
  7182. and gimplify_component_ref if we want an lvalue or not.
  7183. (gimplify_array_ref, gimplify_component_ref): Pass new argument
  7184. WANT_LVALUE through to gimplify_compound_lval.
  7185. (gimplify_compound_lval): If we do not want an lvalue and the
  7186. toplevel COMPONENT_REF's type does not match its field's type,
  7187. then wrap the COMPONENT_REF in a NOP_EXPR and force the
  7188. COMPONENT_REF's type to match its field's type.
  7189. (gimplify_modify_expr): If the RHS is a CALL_EXPR and the LHS
  7190. is not a gimple temporary, then force the RHS through a gimple
  7191. temporary, even if the call can not throw.
  7192. (create_tmp_var): Make sure not to lose the type's attributes
  7193. for the new variable.
  7194. * tree-ssa.c (tree_ssa_useless_type_conversion): New function.
  7195. * tree-flow.h (tree_ssa_useless_type_conversion): Prototype.
  7196. * tree-ssa-dom.c (optimize_stmt): Use tree_ssa_useless_type_conversion.
  7197. * tree-cfg.c (remove_useless_stmts_and_vars): Catch more
  7198. useless statements created during the out-of-ssa pass.
  7199. 2003-08-14 Jeff Law <law@redhat.com>
  7200. * tree-ssa-dom.c (optimize_block): Record equivalences created by
  7201. SWITCH_EXPRs.
  7202. * tree-ssa-dom.c (optimize_stmt): Allow optimizing the RHS of
  7203. a RETURN_EXPR which contains an optimizable MODIFY_EXPR.
  7204. (lookup_avail_expr): Corresponding changes.
  7205. (avail_expr_hash, avail_expr_eq): Likewise.
  7206. * tree-ssa-dom.c (optimize_stmt): Fix typo which prevented
  7207. stores with more than one VDEF from creating useful equivalences.
  7208. * tree-dfa.c (get_expr_operands): Do not special case *0;
  7209. * fold-const.c (fold, case INDIRECT_REF): Revert last change.
  7210. 2003-08-14 Diego Novillo <dnovillo@redhat.com>
  7211. * tree-cfg.c (bsi_insert_on_edge_immediate): Only update the
  7212. container for the head tree of the next block if the new statement
  7213. needs to be linked to it.
  7214. 2003-08-13 Jeff Law <law@redhat.com>
  7215. * fold-const.c (fold, case INDIRECT_REF): Optimize reads from
  7216. constant strings.
  7217. * tree-cfg.c (remove_useless_stmts_and_vars): For a COND_EXPR
  7218. where the condition is a variable and the ELSE clause merely
  7219. sets that variable to zero, remove the ELSE clause.
  7220. * tree-ssa-dom.c (optimize_stmt): Do not check the type of the
  7221. value returned by lookup_avail_expr.
  7222. 2003-08-13 Daniel Berlin <dberlin@dberlin.org>
  7223. * tree-cfg.c (remove_stmt): Add new argument saying whether to remove
  7224. annotations and invalidate defs. Update all callers
  7225. (remove_bsi_from_block): Moved from bsi_remove, argument added.
  7226. (bsi_remove): Made into wrapper for remove_bsi_from_block.
  7227. 2003-08-13 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  7228. * tree-ssa-dom.c (optimize_stmt): Call get_stmt_operands.
  7229. 2003-08-12 Jeff Law <law@redhat.com>
  7230. * tree-ssa-dom.c (optimize_stmt): Record equivalences created
  7231. by memory stores.
  7232. 2003-08-12 Diego Novillo <dnovillo@redhat.com>
  7233. * tree-cfg.c (find_insert_location): Handle other control
  7234. statements that may be at the end of the block.
  7235. 2003-08-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  7236. * Makefile.in (tree-pretty-print.o): Add tree-iterator.h dependency.
  7237. * tree-pretty-print.c: Include tree-iterator.h.
  7238. (dump_generic_node): Avoid recursing into COMPOUND_EXPRs.
  7239. 2003-08-12 Jeff Law <law@redhat.com>
  7240. * tree-ssa-dom.c (optimize_stmt): Optimize ABS_EXPR when we know
  7241. the sign of the source operand.
  7242. * tree-ssa-dom.c (optimize_stmt): Rewrite TRUNC_DIV_EXPR and
  7243. TRUNC_MOD_EXPR even if the LHS is not an SSA variable. Do not
  7244. enter the new expression in the hash tables if !may_optimize_p.
  7245. Also try GE_EXPR to see if this transformation is safe.
  7246. * tree-ssa-dom.c (optimize_stmt): Fix typo in last change which
  7247. prevented recording equivalences created by IOR_EXPR.
  7248. * tree-ssa-dom.c (optimize_stmt): Record that the destination of
  7249. a MODIFY_EXPR nonzero if the RHS contains an IOR with a nonzero
  7250. constant. Turn DIV/MOD by a power of 2 into SHIFT/AND if we know
  7251. dividend is positive.
  7252. 2003-08-11 Jeff Law <law@redhat.com>
  7253. * fold-const.c (fold, cases NE_EXPR and EQ_EXPR): Fold equality
  7254. comparisons of non-weak symbol addresses against zero.
  7255. * tree-ssa-ccp.c (fold_stmt): Strip unnecessary NOP_EXPRs from
  7256. the folded result.
  7257. * gimplify.c (gimplify_expr, case INDIRECT_REF): Copy the base
  7258. object into a temporary if it's in static memory or is addressable.
  7259. 2003-08-11 Steven Bosscher <steven@gcc.gnu.org>
  7260. * tree-alias-common.h (struct tree_alias_ops): Add a semicolon, fix
  7261. bootstrap.
  7262. 2003-08-10 Daniel Berlin <dberlin@dberlin.org>
  7263. * tree-dfa.c (compute_may_aliases): Move points-to initialization from
  7264. here.
  7265. (find_referenced_vars): To here.
  7266. (get_memory_tag_for): Use new same_points_to_set function.
  7267. * tree-alias-common.h (struct tree_alias_ops): Remove doxygen markers.
  7268. Add same_points_to_set function to struct.
  7269. (same_points_to_set): New function.
  7270. * tree-alias-common.c (we_created_global_var): A bit of magic to ignore
  7271. global var aliasing when we didn't create global var. This will go
  7272. away soon
  7273. (same_points_to_set): New function.
  7274. * tree-alias-andersen.c (struct andersen_alias_ops): Add
  7275. andersen_same_points_to_set.
  7276. (andersen_same_points_to_set): New function. Return true if the two
  7277. variables have the same points-to set.
  7278. * opts.c (common_handle_option): Add "none" as a points-to option.
  7279. 2003-08-10 Paul Brook <paul@nowt.org>
  7280. * doc/install.texi: Mention --enable-languages=f95.
  7281. 2003-08-09 Daniel Berlin <dberlin@dberlin.org>
  7282. * tree-pretty-print.c (dump_vops): check bb->tree_annotations, not
  7283. bb->aux.
  7284. 2003-08-08 Daniel Berlin <dberlin@dberlin.org>
  7285. * tree-cfg.c (bsi_insert_on_edge_immediate): If there's only
  7286. one statement in the block, and it's an empty statement, replace it.
  7287. 2003-08-08 Jason Merrill <jason@redhat.com>
  7288. * c-decl.c (c_expand_body_1): Restore support for
  7289. !keep_function_tree_in_gimple_form.
  7290. (finish_function, c_expand_deferred_function): Do TDI_inlined dump.
  7291. * gimplify.c (voidify_wrapper_expr): Set TREE_SIDE_EFFECTS on the
  7292. wrapper if we insert a MODIFY_EXPR.
  7293. 2003-08-07 Diego Novillo <dnovillo@redhat.com>
  7294. * Makefile.in (GTFILES): Add tree-ssa.c, tree-dfa.c and
  7295. tree-ssa-ccp.c.
  7296. (gt-tree-ssa.h, gt-tree-dfa.h, gt-tree-ssa-ccp.h): Depend on
  7297. s-gtype.
  7298. * tree-dfa.c (struct clobber_data_d): Remove. Update all users.
  7299. (struct alias_map_d): Mark for garbage collection.
  7300. (struct walk_state): Add fields 'is_not_gimple' and
  7301. 'is_va_arg_expr'.
  7302. (clobber_vars_r): Remove. Update all users.
  7303. (get_stmt_operands): Abort if attempting to get operands from a
  7304. non-GIMPLE statement.
  7305. (get_expr_operands): Likewise.
  7306. Do not force a virtual operand when scanning VA_ARG_EXPR.
  7307. (add_stmt_operand): If the variable has hidden uses, mark the
  7308. statement as having volatile operands and return.
  7309. If the variable occurs inside a VA_ARG_EXPR, add it as a virtual
  7310. operand.
  7311. (add_immediate_use): Call VARRAY_TREE_INIT instead of
  7312. VARRAY_GENERIC_PTR_INIT.
  7313. (dump_variable): Check is_in_va_arg_expr flag.
  7314. (compute_may_aliases): Move code to find variables ...
  7315. (find_referenced_vars): ... here.
  7316. (find_vars_r): Abort if we find a non-GIMPLE expression
  7317. unexpectedly.
  7318. Mark variables found inside a VA_ARG_EXPR.
  7319. Do not scan arguments for non-GIMPLE CALL_EXPRs.
  7320. Remove local variable saved_is_store.
  7321. Reformat some code for readability.
  7322. (add_referenced_var): If the variable is already marked as having
  7323. hidden uses, ignore it.
  7324. If the variable is found inside a non-GIMPLE expression, mark it.
  7325. If the variable is found inside a VA_ARG_EXPR, mark it.
  7326. * tree-flow.h (struct var_ann_d): Add field is_in_va_arg_expr.
  7327. (find_referenced_vars): Declare.
  7328. * tree-optimize.c (optimize_function_tree): Call
  7329. find_referenced_vars before computing may aliases.
  7330. * tree-ssa-dce.c (need_to_preserve_store): Do not check if the
  7331. variable has hidden uses.
  7332. * tree-ssa-live.c (type_var_init): Likewise.
  7333. * tree-ssa-ccp.c (ssa_edges): Mark for garbage collection.
  7334. (tree_ssa_ccp): Use VARRAY_.*_EDGE calls to manipulate the varray
  7335. of CFG edges.
  7336. (add_control_edge): Likewise.
  7337. (initialize): Likewise.
  7338. * tree-ssa.c (struct def_blocks_d): Mark for garbage collection.
  7339. (struct var_value_d): Likewise.
  7340. (def_blocks_free): Remove. Update all users.
  7341. (rewrite_into_ssa): Do not specify free function when creating
  7342. def_blocks and currdefs.
  7343. Call sbitmap_free instead of free.
  7344. (mark_def_sites): Call sbitmap_free instead of free.
  7345. (set_def_block): Use GC allocation.
  7346. (set_livein_block): Likewise.
  7347. (insert_phi_nodes): Adjust name of varray def_maps when creating it.
  7348. (insert_phis_for_deferred_variables): Remove call to BITMAP_XFREE.
  7349. (insert_phi_nodes_for): Use GC allocation for phi_insertion_points.
  7350. (init_tree_ssa): Remove typecast in call to memset.
  7351. (set_value_for): Use GC allocation.
  7352. (get_def_blocks_for): Remove typecast in call to htab_find.
  7353. * varray.c (element): Add entry for struct edge_def *.
  7354. * varray.h (enum varray_data_enum): Add VARRAY_DATA_EDGE.
  7355. (union varray_data_tag): Add field of type struct edge_def *.
  7356. (VARRAY_EDGE_INIT): Define.
  7357. (VARRAY_EDGE): Define.
  7358. (VARRAY_PUSH_EDGE): Define.
  7359. (VARRAY_TOP_EDGE): Define.
  7360. 2003-08-06 Diego Novillo <dnovillo@redhat.com>
  7361. * tree-cfg.c (handle_switch_fallthru): Do not abort when the last
  7362. statement of the case block needs to be the last statement of the
  7363. block.
  7364. (find_insert_location): Fix typo.
  7365. 2003-08-06 Steven Bosscher <steven@gcc.gnu.org>
  7366. * tree-dfa.c (remove_phi_arg): When the PHI no longer has
  7367. arguments, don't remove it here, but do so...
  7368. (remove_phi_arg_num): ...from here.
  7369. 2003-08-05 Jason Merrill <jason@redhat.com>
  7370. * gimplify.c (gimplify_cond_expr): Gimplify shortcut expansion in
  7371. a conditional context.
  7372. * tree-cfg.c (make_catch_expr_blocks): Don't change next_block_link.
  7373. (make_eh_filter_expr_blocks): Likewise.
  7374. * tree-dfa.c (add_referenced_var): Static locals are call
  7375. clobbered.
  7376. 2003-08-05 Steven Bosscher <steven@gcc.gnu.org>
  7377. * tree-dfa.c (add_phi_arg): Allow PHI capacity to grow.
  7378. * tree-flow.h (add_phi_arg): Adjust prototype.
  7379. * tree-ssa-pre.c (code_motion): Adjust call.
  7380. * tree-ssa.c (rewrite_block): Likewise.
  7381. * tree.c (resize_phi_node): New function.
  7382. * tree.h (resize_phi_node): Add prototype.
  7383. 2003-08-05 Jeff Law <law@redhat.com>
  7384. * tree-ssa-dom.c (optimize_block): Be more aggressive about
  7385. creating equivalences from PHI nodes.
  7386. * tree-ssa-dom.c (optimize_stmt): Strip away certain NOP_EXPRs
  7387. before determining if we have an equivalence to enter into
  7388. the const_and_copies table.
  7389. * tree-ssa-dce.c (remove_dead_stmts): Iterate backwards through the
  7390. basic blocks removing dead statements. Within each block iterate
  7391. backwards through the statements removing those which are dead.
  7392. * tree-ssa-optimize.c (optimize_function_tree): Call
  7393. remove_useless_stmts_and_vars before building the flow graph.
  7394. * tree-cfg.c (remove_useless_stmts_and_vars): Rename argument from
  7395. first_iteration to remove_unused_vars.
  7396. * tree-cfg.c (remove_unreachable_blocks): Remove blocks in reverse
  7397. order.
  7398. (remove_bb): Remove unwanted call to bsi_next.
  7399. (bsi_remove): Refine code which removes useless COMPOUND_EXPRs to allow
  7400. removal if one of the arms is not associated with a basic block.
  7401. (remove_stmt): Improve check for testing when a basic block head/end
  7402. pointer needs to be updated when removing a COMPOUND_EXPR.
  7403. * tree-cfg.c (phi_alternatives_equal): New function.
  7404. (linearize_cond_expr): Allow linearization if the PHI nodes at the
  7405. target have equivalent arguments for the incoming edges from the THEN
  7406. and ELSE clauses.
  7407. * tree-ssa-dce.c (mark_tree_necessary): Empty statements may be
  7408. necessary.
  7409. (process_worklist): Handle any incoming abnormal edges the first
  7410. time a statement in each block becomes executable.
  7411. * tree-ssa-ccp.c (substitute_and_fold): Substitute known
  7412. constants into PHI nodes.
  7413. 2003-08-04 Sebastian Pop <s.pop@laposte.net>
  7414. * basic-block.h: Declare bb_ann_d.
  7415. (basic_block_def): Add a field tree_annotations.
  7416. * cfg.c (entry_exit_blocks): Initialize tree_annotations to NULL.
  7417. * cfghooks.c: Remove the definition of cfg_level.
  7418. (rtl_register_cfg_hooks): Remove the initiallization of cfg_level.
  7419. * cfghooks.h (cfg_hooks): Add cfgh_loop_optimizer_init, and
  7420. cfgh_loop_optimizer_finalize.
  7421. (loop_optimizer_init, loop_optimizer_finalize): New macros.
  7422. (cfg_level): Remove.
  7423. * cfgloop.h (loop_optimizer_init, loop_optimizer_finalize): Rename
  7424. to rtl_loop_optimizer_init and rtl_loop_optimizer_finalize.
  7425. * cfgrtl.c (rtl_loop_optimizer_init, rtl_loop_optimizer_finalize):
  7426. Declare, and register them in rtl_cfg_hooks and cfg_layout_rtl_cfg_hook.
  7427. * loop-init.c (loop_optimizer_init, loop_optimizer_finalize): Rename
  7428. to rtl_loop_optimizer_init and rtl_loop_optimizer_finalize. Remove
  7429. the checks to cfg_level.
  7430. * tree-cfg.c (block_tree_ann_obstack, first_block_tree_ann_obj): New.
  7431. (create_blocks_annotations, create_block_annotation,
  7432. free_blocks_annotations, clear_blocks_annotations): New functions.
  7433. (tree_loop_optimizer_init, tree_loop_optimizer_finalize): New
  7434. functions. Register them in tree_cfg_hooks.
  7435. (build_tree_cfg, dump_tree_bb, delete_tree_cfg, tree_split_edge): Use
  7436. create_blocks_annotations instead of alloc_aux_for_blocks,
  7437. create_block_annotation instead of alloc_aux_for_block,
  7438. .tree_annotations instead of .aux,
  7439. free_blocks_annotations instead of free_aux_for_blocks.
  7440. (tree_register_cfg_hooks): Remove initialization of cfg_level.
  7441. * tree-flow-inline.h (bb_ann): Use .tree_annotations.
  7442. * tree-flow.h: Update comment.
  7443. 2003-08-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
  7444. * Makefile.in (c-pretty-print.o): Add TREE_H and C_TREE_H dependencies.
  7445. 2003-08-01 Paul Brook <paul@nowt.org>
  7446. * Makefile.in (GMPINC): Set and use.
  7447. (GMPLIBS): Set it.
  7448. * configure.in: Add test and switches for the GMP library.
  7449. (all_need_gmp): Set from config-lang.in.
  7450. * sourcebuild.texi: Document need_gmp.
  7451. * configure: regen
  7452. 2003-08-01 Steven Bosscher <steven@gcc.gnu.org>
  7453. * tree-inline.c (expand_calls_inline): Fix comments.
  7454. 2003-07-31 Diego Novillo <dnovillo@redhat.com>
  7455. * Makefile.in (tree-ssa-ccp.o): Depend on $(EXPR_H).
  7456. * builtins.c (c_strlen): Remove static declaration.
  7457. (simplify_builtin_fputs): Remove static declaration.
  7458. (simplify_builtin_sprintf): New local function.
  7459. (expand_builtin_sprintf): Remove by surrounding with #if 0.
  7460. (expand_builtin): Add BUILT_IN_SPRINTF to the list of built-ins
  7461. handed over to simplify_builtin.
  7462. (validate_arglist): Do not allow arguments with TREE_SIDE_EFFECTS.
  7463. (simplify_builtin_fputs): Add new argument KNOWN_LEN. If it's set,
  7464. use it instead of trying to compute the length of the string.
  7465. Update all callers.
  7466. * expr.h (simplify_builtin_fputs): Declare.
  7467. * tree-flow.h (fold_stmt): Change argument type to tree *. Update
  7468. all users.
  7469. * tree-ssa-ccp.c: Include expr.h.
  7470. (replace_uses_in): If the statement makes a call to some selected
  7471. built-ins, mark it for folding.
  7472. (get_strlen): New local function.
  7473. (ccp_fold_builtin): New local function.
  7474. (fold_stmt): Call it.
  7475. (set_rhs): Fix if-else-if chaining. Handle cases where the whole
  7476. statement needs to be replaced.
  7477. * tree.h (c_strlen): Declare.
  7478. 2003-07-31 Diego Novillo <dnovillo@redhat.com>
  7479. Fix PR optimization/11373
  7480. * tree-ssa-dce.c (stmt_useful_p): Get statement operands before
  7481. checking for volatile operands.
  7482. * tree-dfa.c (get_expr_operands): If a constant is dereferenced as a
  7483. pointer, mark the statement as having volatile operands.
  7484. (may_access_global_mem_p): If a non-NULL constant is used as a
  7485. pointer, consider it as pointing to global memory.
  7486. * tree-ssa-dom.c (optimize_stmt): Set addr_expr_propagated_p when
  7487. propagating pointers that are integer constants.
  7488. 2003-07-31 Andrew MacLeod <amacleod@redhat.com>
  7489. * tree-dfa.c (add_stmt_operand): Don't treat complex types as scalars.
  7490. * tree-ssa-live.c (var_union): Change comment.
  7491. (coalesce_tpa_members): Don't proceed if var_union fails.
  7492. * tree-ssa.c (insert_copy_on_edge): Change comment.
  7493. (coalesce_abnormal_edges): Handle var_union failing.
  7494. (coalesce_vars): Skip constant PHI arguments.
  7495. 2003-07-30 Jeff Law <law@redhat.com>
  7496. * tree-cfg.c (bsi_remove): Don't remove a COMPOUND_EXPR with empty
  7497. arms if the arms are in different basic blocks.
  7498. * tree-ssa-dom.c (record_cond_is_false): New function.
  7499. (record_cond_is_true): Similarly.
  7500. (get_eq_expr_value): Use record_cond_expr_is_{true,false}.
  7501. (optimize_stmt): Fix minor formatting issue. If we encounter an
  7502. INDIRECT_REF, record that the dereferenced pointer can not be
  7503. null.
  7504. 2003-07-30 Daniel Berlin <dberlin@dberlin.org>
  7505. * tree-dump.c (dump_option_value_in): "all" is now everything but
  7506. TDF_RAW and TDF_SLIM.
  7507. 2003-07-30 Diego Novillo <dnovillo@redhat.com>
  7508. * tree-simple.c (is_gimple_const): Accept CONST + CONST expressions
  7509. as GIMPLE constants.
  7510. 2003-07-30 Daniel Berlin <dberlin@dberlin.org>
  7511. * tree-ssa-pre.c: #include real.h
  7512. (defs_match_p): Change arguments to something normal now that we use
  7513. the new renaming algorithm. Update all callers.
  7514. Use defs_hash_expr.
  7515. (defs_y_dom_x): Ditto.
  7516. (defs_hash_expr): New. Based on iterative_hash_expr.
  7517. (generate_exr_as_of_bb): If there aren't any uses, return.
  7518. (subst_phis): Call modify_stmt on the actually modified statement. :)
  7519. (get_default_def): Only walk SSA_NAME arguments in PHI's.
  7520. 2003-07-30 Jason Merrill <jason@redhat.com>
  7521. Don't modify code that is already GIMPLE.
  7522. * gimplify.c (gimplify_expr): Don't return early if the predicate
  7523. matches.
  7524. Use a variable temp if the caller wants an lvalue.
  7525. Don't call gimplify_constructor if we're on the rhs of a MODIFY_EXPR.
  7526. (add_tree, add_stmt_to_compound): Do add an empty stmt if we
  7527. previously had nothing at all.
  7528. (gimplify_return_expr): Don't mess with iterators if it was already
  7529. gimple.
  7530. (gimplify_cond_expr): Remove a COND_EXPR with two empty arms.
  7531. (gimplify_call_expr): Try to simplify a builtin again after
  7532. gimplifying the args.
  7533. (internal_get_tmp_var): Gimplify the new MODIFY_EXPR.
  7534. (gimplify_expr, gimple_push_cleanup): Use boolean_false_node.
  7535. (gimplify_init_constructor): New fn, broken out from...
  7536. (gimplify_modify_expr): ...here. Be smarter about zero-initialization.
  7537. * tree-simple.c (is_gimple_rhs): Accept any CONSTRUCTOR.
  7538. * tree-simple.h: Adjust add_tree prototype.
  7539. 2003-07-29 Daniel Berlin <dberlin@dberlin.org>
  7540. * tree-alias-common.c (create_alias_vars): If we created global_var,
  7541. delete it when we are done.
  7542. (ptr_may_alias_var): Handle case that global_var is now NULL_TREE.
  7543. 2003-07-29 Jeff Law <law@redhat.com>
  7544. * tree-ssa-dom.c (optimize_stmt): Propagate copies into VUSEs and
  7545. the RHS of VDEFs.
  7546. 2003-07-29 Andrew MacLeod <amacleod@redhat.com>
  7547. * tree-ssa.c (insert_copy_on_edge): Only set used bit on DECL nodes.
  7548. 2003-07-29 Andrew MacLeod <amacleod@redhat.com>
  7549. * common.opt (ftree-combine-temps): Add new option.
  7550. * flags.h (flag_tree_combine_temps): New flag.
  7551. * opts.c (decode_options): Initialize flag_tree_combine_temps.
  7552. (common_handle_option): Handle new flag.
  7553. * toplev.c (flag_tree_combine_temps): Declare.
  7554. (lang_independent_options f): Add tree-combine-temp.
  7555. * tree-ssa-live.c (var_union): When combining 2 root variables, choose
  7556. the user variable over a temporary as the new variable.
  7557. (compact_var_map): Use renamed root_var routines.
  7558. (calculate_live_on_exit): Reformatting.
  7559. (tpa_init): Initialize a tpa object.
  7560. (tpa_remove_partition): Remove a partition from a tpa list.
  7561. (tpa_delete): Delete a tpa object.
  7562. (tpa_compact): Hide single elemenet lists.
  7563. (root_var_init): Split common part into tpa_init and rename.
  7564. (remove_root_var_partition, delete_root_va, dump_root_var): Delete.
  7565. (type_var_init): New. Initialize a type_var object.
  7566. (create_coalesce_list): New. Create a coalesce_list object.
  7567. (delete_coalesce_list): New. Free a coalesce list's memory.
  7568. (find_partition_pair): New. Find a coalesce pair in a coalesce list.
  7569. (add_coalesce): New. Add a coalesce between 2 partitions.
  7570. (sort_coalesce_list): New. Sort coalesce pairs by importance.
  7571. (pop_best_coalesce): New. Get best remaining pair to coalesce.
  7572. (add_conflicts_if_valid): Move from tree-ssa.c.
  7573. (build_tree_conflict_graph): Move from coalesce_ssa_name in tree-ssa.c.
  7574. Genericize to use tpa_p instead of root_var object. Don't add
  7575. interferences between copies. Update coalesce list.
  7576. (coalesce_tpa_members): Move from coalesce_ssa_name in tree-ssa.c. Use
  7577. tpa_p instead of root_var. Use coalesce list if provided.
  7578. (dump_coalesce_list): New. Show debug info for a coalesce list.
  7579. (tpa_dump): Rename from dump_root_var and genericize to use tpa_p.
  7580. * tree-ssa-live.h (root_var_p): Rename structure type to tpa_p
  7581. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition,
  7582. tpa_find_tree): New. Generic versions of existing root_var routines.
  7583. (tpa_decompact): New. Include single version lists.
  7584. (root_var_p): Declare as type tpa_p.
  7585. (root_var_num, root_var, root_var_first_partition,
  7586. root_var_next_partition, root_var_dump, root_var_delete,
  7587. root_var_remove_partition, root_var_find , root_var_compac,
  7588. root_var_decompac): Rename and call generic versions.
  7589. (type_var_p): New. Use tpa_p structure for a type based association.
  7590. (type_var_num, type_var, type_var_first_partition,
  7591. type_var_next_partition, type_var_dump, type_var_delete,
  7592. type_var_remove_partition, type_var_find, type_var_compact,
  7593. type_var_decompact): New. Call generic versions of the routine.
  7594. (struct partition_pair_d): New. Represent a desired coalesce.
  7595. (struct coalesce_list_d): New. Organize lists of desired coalesces.
  7596. (NO_BEST_COALESCE): Define value.
  7597. * tree-ssa.c (set_if_valid): Remove.
  7598. (insert_copy_on_edge): Set variable as used when inserting a copy.
  7599. (add_conflicts_if_valid): Remove. Move to tree-ssa-live.c.
  7600. (print_exprs): New. Routine for commonly used output format.
  7601. (coalesce_abnormal_edges): New. Split from coalece_ssa_name. Force
  7602. partition coalesces across abnormal edges.
  7603. (coalesce_ssa_name): Split out build_tree_conflict_graph,
  7604. coalesce_abnormal_edges, and coalesce_tpa_members. Return live
  7605. range info if required. Use renamed root_var routines.
  7606. (assign_vars): Use renamed root_var routines.
  7607. (replace_variable): Mark as inline.
  7608. (coalesce_vars): Coalesce variable memory storage.
  7609. (rewrite_out_of_ssa): Don't compact varmap anymore. Free live range
  7610. info if required. Call coalesce_vars if combining temps.
  7611. 2003-07-29 Andrew MacLeod <amacleod@redhat.com>
  7612. * tree-cfg.c (handle_switch_fallthru): Use bsi_link_after if stmt is
  7613. in a basic block.
  7614. 2003-07-28 Diego Novillo <dnovillo@redhat.com>
  7615. * opts.c (decode_options): Disable must-alias optimization.
  7616. 2003-07-28 Andrew MacLeod <amacleod@redhat.com>
  7617. * tree-ssa.c (struct _elim_graph): Add varray for constant copies.
  7618. (new_elim_graph): Initialize constant copy array..
  7619. (eliminate_build): Push constant copies onto stack instead of emitting.
  7620. (eliminate_phi): Emit any pending constant copies.
  7621. 2003-07-28 Jeff Law <law@redhat.com>
  7622. * tree-ssa-dom.c (optimize_block): If a PHI has a single argument
  7623. that is a constant, then that creates a useful equivalence.
  7624. Propagate constant values into PHI nodes.
  7625. * tree-flow-inline.h (may_propagate_copy): Allow RHS to be a
  7626. constant.
  7627. * tree-dfa.c (compute_immediate_uses_for): Do not assume that
  7628. PHI arguments are SSA_NAMEs.
  7629. * tree-ssa-dce.c (process_worklist): Likewise.
  7630. * tree-ssa-copyprop.c (copyprop_phi): Likewise. Use may_propagate_copy.
  7631. * tree-ssa-ccp.c (visit_phi_node): Do not assume that PHI arguments
  7632. are SSA_NAMEs. Create a suitable value if a PHI argument is a
  7633. constant.
  7634. * tree-cfg.c (move_outgoing_edges): Correctly handle case where
  7635. an edge already exists from BB1 to BB2's successor.
  7636. 2003-07-27 Daniel Berlin <dberlin@dberlin.org>
  7637. * tree.h (EREF_TEMP): Rename to EPHI_TEMP.
  7638. (tree_eref_common): Move temp to tree_ephi_node.
  7639. * tree-ssa-pre.c: Remove #if 0'd code.
  7640. Use EPHI_TEMP rather than EREF_TEMP, remove EREF_TEMP on EUSE nodes.
  7641. (finalize_1): Handle empty blocks properly.
  7642. 2003-07-27 Andreas Jaeger <aj@suse.de>
  7643. * tree.c: Convert remaining K&R prototypes to ISO C90.
  7644. * tree-dump.c: Likewise.
  7645. * tree-inline.c: Likewise.
  7646. * stmt.c (expand_asm_expr): Likewise.
  7647. * diagnostic.h: Remove PARAMS.
  7648. 2003-07-26 Paul Brook <paul@nowt.org>
  7649. * Makefile.in: Rename check-g95 to check-gfortran.
  7650. * gcc.c (default_compilers): Add entries for .f90 and .f95.
  7651. * doc/frontends.texi: Document new F95 front end.
  7652. * doc/install.texi: Ditto.
  7653. * doc/invoke.texi: Ditto.
  7654. * doc/sourcebuild.texi: Ditto.
  7655. * fortran: New front end.
  7656. 2003-07-25 Jeff law <law@redhat.com>
  7657. * tree-ssa-dom.c (optimize_block): Use may_propagate_copy.
  7658. 2003-07-25 Diego Novillo <dnovillo@redhat.com>
  7659. * opts.c (decode_options): Re-enable must-alias optimizations.
  7660. 2003-07-25 Daniel Berlin <dberlin@dberlin.org>
  7661. * configure.in: Update BANSHEEREBUILD for PWD change.
  7662. * configure: regen
  7663. 2003-07-25 Andreas Jaeger <aj@suse.de>
  7664. * c-call-graph.c: Convert to ISO C90.
  7665. * c-common.c: Likewise.
  7666. * c-mudflap.c: Likewise.
  7667. * c-pretty-print.c: Likewise.
  7668. * cfganal.c (find_edge): Likewise.
  7669. * dependence.c: Likewise.
  7670. * diagnostic.c (debug_output_buffer): Likewise.
  7671. * except.c (expand_eh_handler): Likewise.
  7672. * fold-const.c: Likewise.
  7673. * langhooks.c: Likewise.
  7674. * tree-cfg.c (last_exec_block): Likewise.
  7675. * tree-ssa-pre.c: Likewise.
  7676. * builtins.c: Likewise.
  7677. * tree.h: Remove remaining PARAMS.
  7678. * c-common.h: Likewise.
  7679. * c-pretty-print.h: Likewise
  7680. * c-tree.h: Likewise.
  7681. * except.h: Likewise.
  7682. * langhooks-def.h: Likewise.
  7683. * langhooks.h: Likewise.
  7684. 2003-07-24 Diego Novillo <dnovillo@redhat.com>
  7685. * tree-dfa.c (cleanup_operand_arrays): New local function. Remove
  7686. superfluous VUSE operands.
  7687. (get_stmt_operands): Call it.
  7688. 2003-07-24 Jason Merrill <jason@redhat.com>
  7689. * gimplify.c (gimple_boolify): New fn.
  7690. (gimplify_expr) <TRUTH_NOT_EXPR>: Boolify arg.
  7691. (gimplify_cond_expr): Boolify condition.
  7692. (gimplify_boolean_expr): Boolify args.
  7693. (gimple_push_cleanup): Make flag boolean.
  7694. * tree-simple.c (is_gimple_relop): TRUTH_{AND,OR,XOR}_EXPR
  7695. are not comparisons.
  7696. (is_gimple_binary_expr): They are binary ops.
  7697. * tree-mudflap.c (mf_build_check_statement_for): Use TRUTH_OR_EXPR
  7698. rather than BIT_IOR_EXPR.
  7699. 2003-07-23 Jason Merrill <jason@redhat.com>
  7700. Diego Novillo <dnovillo@redhat.com>
  7701. * c-common.h (DECL_C_HARD_REGISTER): Replace ...
  7702. * tree.h (DECL_HARD_REGISTER): ... with this. Update all users.
  7703. 2003-07-23 Diego Novillo <dnovillo@redhat.com>
  7704. * tree-flow-inline.h (may_propagate_copy): New function.
  7705. * tree-flow.h (may_propagate_copy): Declare.
  7706. * tree-ssa-copyprop.c (copyprop_stmt): Call it.
  7707. (get_original): Likewise.
  7708. * tree-ssa-dom.c (optimize_stmt): Likewise.
  7709. 2003-07-23 Frank Ch. Eigler <fche@redhat.com>
  7710. * gcc.c (MFWRAP_SPEC): Also wrap pthread_join and pthread_exit.
  7711. 2003-07-23 Steven Bosscher <steven@gcc.gnu.org>
  7712. * tree-flow-inline.h (remove_dom_child): New function.
  7713. (clear_dom_children): New function.
  7714. * tree-cfg.c (bsi_insert_on_edge_immediate): Do not clear
  7715. the annotation for the new bb, it is already memset to zero
  7716. in alloc_aux_for_block().
  7717. (move_outgoing_edges): Use dom_children() instead of looking
  7718. at the dom_children field in the basic block annotation.
  7719. * tree-ssa.c (rewrite_into_ssa): Use clear_dom_children().
  7720. * tree-cfg.c (dump_tree_cfg): Dump to `file', not `dump_file'.
  7721. 2003-07-23 Diego Novillo <dnovillo@redhat.com>
  7722. * tree.h (DECL_ESTIMATED_INSNS): Move from c-common.h.
  7723. 2003-07-23 Steven Bosscher <steven@gcc.gnu.org>
  7724. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Make
  7725. found_unreachable a bool. Create/delete hash tables for
  7726. copies and available exprs outside the main loop. Use
  7727. htab_clean to wipe them after each iteration.
  7728. 2003-07-22 Diego Novillo <dnovillo@redhat.com>
  7729. * opts.c (decode_options): Add temporary test for environment
  7730. variable TREE_SSA_DO_PRE.
  7731. Do not disable dominator optimizations when PRE is enabled.
  7732. 2003-07-22 Daniel Berlin <dberlin@dberlin.org>
  7733. * tree-ssa-pre.c (finalize_1): Change to not use bsi_last.
  7734. 2003-07-22 Daniel Berlin <dberlin@dberlin.org>
  7735. * tree-cfg.c (remove_stmt): Revert 07-15 change. Turns out the bug is in
  7736. the reverse iterator.
  7737. 2003-07-22 Diego Novillo <dnovillo@redhat.com>
  7738. * tree-ssa-ccp.c (visit_phi_node): Assume default value of CONSTANT
  7739. if the PHI value was already constant.
  7740. 2003-07-22 Andrew MacLeod <amacleod@redhat.com>
  7741. * c-pretty-print.c (print_call_name): Handle COND_EXPR correctly.
  7742. * tree-pretty-print.c (print_call_name): Handle COND_EXPR correctly and
  7743. handle SSA_NAME.
  7744. * tree-dfa.c (add_phi_arg, remove_phi_arg_num): Remove references to
  7745. SSA_NAME_HAS_REAL_REFS.
  7746. * tree-ssa-ccp.c (visit_phi_node): Remove SSA_NAME_HAS_REAL_REFS.
  7747. * tree-ssa-copyprop.c (copyprop_phi): Remove SSA_NAME_HAS_REAL_REFS.
  7748. * tree-ssa-live.c (register_ssa_partition): Register the PHI and it's
  7749. arguments if this variable is defined by a PHI.
  7750. (create_ssa_var_map): Only register real uses and defs, and virtual
  7751. operands of ASM_EXPR's. Remove SSA_NAME_HAS_REAL_REFS. Don't set
  7752. used flag on variables here.
  7753. (calculate_live_on_entry): Ignore constants in PHI arguments.
  7754. (calculate_live_on_exit): Ignore constants in PHI arguments.
  7755. (dump_live_info): New. Dump live range information.
  7756. * tree-ssa-live.h (dump_live_info): New prototype and flags.
  7757. * tree-ssa-pre.c (create_expr_ref, finalize_1, repair_use_injury,
  7758. code_motion): Remove SSA_NAME_HAS_REAL_REFS.
  7759. * tree-ssa.c (rewrite_operand, register_new_def): Remove real_ref
  7760. parameter and SSA_NAME_HAS_REAL_REFS.
  7761. (rewrite_block): Remove real_ref parameter from register_new_def call.
  7762. (eliminate_build): Remove SSA_NAME_HAS_REAL_REFS. Insert copy if PHI
  7763. argument is a constant. Handle irregular PHI argument ordering.
  7764. (elim_create): Remove dead code to count PHI nodes.
  7765. (assign_vars): Set used flag on variables when assigned.
  7766. (replace_variable): Eliminate dead code.
  7767. (coalesce_ssa_name): Remove SSA_NAME_HAS_REAL_REFS. Print error for
  7768. constant argument across an abnormal edge.
  7769. (eliminate_extraneous_phis): New. Remove PHI nodes which are not in
  7770. the partition.
  7771. (rewrite_out_of_ssa): Call eliminate_extraneous_phis.
  7772. (rewrite_stmt): Remove real_ref parameter from rewrite_operand and
  7773. register_new_def.
  7774. * tree.h (SSA_NAME_HAS_REAL_REFS): Remove.
  7775. (struct tree_ssa_name): Remove 'has_real_refs' field.
  7776. 2003-07-22 Daniel Berlin <dberlin@dberlin.org>
  7777. * tree-ssa-pre.c (factor_through_injuries): Take new argument specifying
  7778. whether use was injured or not (needed for SR). Update all callers.
  7779. (maybe_find_rhs_use_for_var): Take new argument specifying which
  7780. operand to start search with. Update all callers.
  7781. (phi_opnd_from_res): #if 0 out.
  7782. (rename_2): Ditto.
  7783. (rename_1): Ditto.
  7784. (defs_match_p): Take new arguments specifying which defs were injured.
  7785. Update all callers.
  7786. (defs_y_dom_x): Ditto.
  7787. (generate_expr_as_of_bb): Fix small memory overwrite.
  7788. (process_delayed_rename): Propagate injured flag around.
  7789. (new_rename_1): Ditto.
  7790. (finalize_1): Get correct variable names for newly created statement if
  7791. necessary due to PHI.
  7792. (repair_use_injury): Note the repair in the stats. Insert repair
  7793. in right place.
  7794. (repair_euse_injury): Fix handling of PHI_NODE.
  7795. (code_motion): Fix algorithm so it can handle using reaching_def all the
  7796. time (needed for SR).
  7797. Use reaching_def rather than EREF_TEMP.
  7798. 2003-07-21 Diego Novillo <dnovillo@redhat.com>
  7799. * tree-dfa.c (get_stmt_operands): Remove FIXME note
  7800. regarding virtual operands for ASM_EXPRs.
  7801. 2003-07-21 Diego Novillo <dnovillo@redhat.com>
  7802. * tree-dfa.c (add_def): Renamed from set_def. Update all users.
  7803. (get_stmt_operands): Don't force ASM_EXPR operands to be virtual.
  7804. (add_stmt_operand): Allow non-assignments to create new defs.
  7805. * tree-dump.c (dump_function): Move header dump...
  7806. (dump_function_to_file): ... here.
  7807. * tree-flow-inline.h (def_ops): Renamed from def_op. Return a
  7808. varray with all the definitions made by the statement.
  7809. Update all users.
  7810. * tree-flow.h (struct operands_d): Rename field 'def_op' to
  7811. 'def_ops'. Convert it into a varray.
  7812. * tree-must-alias.c (tree_compute_must_alias): Call
  7813. dump_function_to_file instead of dump_function.
  7814. * tree-ssa-ccp.c (tree_ssa_ccp): Likewise.
  7815. (visit_stmt): Only visit statements that make new definitions using
  7816. MODIFY_EXPR.
  7817. Definitions coming from other statements are considered VARYING.
  7818. * tree-ssa-copyprop.c (tree_ssa_copyprop): Call
  7819. dump_function_to_file instead of dump_function.
  7820. * tree-ssa-dce.c (tree_ssa_dce): Likewise.
  7821. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise.
  7822. (optimize_stmt): Don't abort if a statement makes more than one
  7823. definition.
  7824. Check for MODIFY_EXPR statements directly, instead of relying on
  7825. the presence of a single definition.
  7826. * tree-ssa-pre.c (tree_perform_ssapre): Call dump_function_to_file
  7827. instead of dump_function.
  7828. * tree-ssa.c (rewrite_into_ssa): Likewise.
  7829. Dump the function before dominator optimizations if TDF_DETAILS is
  7830. set.
  7831. (rewrite_stmt): Don't abort if the statement makes more than one
  7832. definition.
  7833. 2003-07-21 Jeff Law <law@redhat.com>
  7834. * tree-ssa-dom.c (tree_ssa_dominator_optimize): If we made any
  7835. blocks unreachable, repeat the dominator optimizations.
  7836. (optimize_block): Enter PHIs with a single source argument into
  7837. the const_and_copies table. When propagating into a PHI node,
  7838. break the loop over the PHI arguments when a propagation is performed.
  7839. If the PHI agument is not an SSA_VAR, then no propagation is possible.
  7840. (optimize_stmt): If an operand is not an SSA_VAR, then no propagation
  7841. is possible/needed.
  7842. 2003-07-21 Diego Novillo <dnovillo@redhat.com>
  7843. * Makefile.in (tree-ssa-dom.o): Add dependency on $(TREE_DUMP_H).
  7844. * fold-const.c (fold): Remove unusued local variable 'invert'.
  7845. * tree-dump.c (dump_files): Add entry for -fdump-tree-dom.
  7846. * tree-flow.h (tree_ssa_dominator_optimize): Change declaration to
  7847. accept a function decl.
  7848. * tree-ssa-dom.c: Include timevar.h and tree-dump.h.
  7849. (tree_ssa_dominator_optimize): Change to receive the function decl
  7850. for the function to optimize. Update callers.
  7851. Use own dump file instead of dumping on the .ssa dump file.
  7852. Dump function at the end.
  7853. Push and pop TV_TREE_SSA_DOMINATOR_OPTS.
  7854. * tree-ssa.c (rewrite_into_ssa): Restore check for number of times
  7855. that the rename loop has been executed. Abort if the loop executes
  7856. more than twice.
  7857. * tree.h (enum tree_dump_index): Add TDI_dom.
  7858. * doc/invoke.texi: Document -fdump-tree-dom.
  7859. 2003-07-21 Steven Bosscher <steven@gcc.gnu.org>
  7860. Diego Novillo <dnovillo@redhat.com>
  7861. * Makefile.in (install-po): Check if $CATALOGS is empty to avoid
  7862. buggy shells.
  7863. * basic-block.h (rtl_verify_flow_info): Remove.
  7864. (tree_verify_flow_info): Remove.
  7865. (verify_flow_info): Declare.
  7866. * builtins.c: Rearrange to simplify merges. Add #if 0 around
  7867. expand_ functions that are not used in the branch and move new code
  7868. to the end of the file.
  7869. * c-opts.c (c_common_handle_option): Move handling of -fdump- to
  7870. opts.c.
  7871. * cfgloopmanip.c (loop_split_edge_with_NULL): Remove. Update all
  7872. users.
  7873. * common.opt: Add all the tree-ssa switches.
  7874. * opts.c: Handle them.
  7875. * flags.h (flag_tree_cp): Remove unused variable.
  7876. (enum pta_type): Move from tree-must-alias.h
  7877. (flag_tree_points_to): Likewise.
  7878. * toplev.c (flag_tree_cp): Remove unused variable.
  7879. * tree-cfg.c: Move cfg_hooks structures and functions for
  7880. trees from cfghooks.c.
  7881. * tree-mudflap.c (mudflap_enqueue_decl): Don't use %D to
  7882. avoid warning about format specifiers.
  7883. 2003-07-21 Diego Novillo <dnovillo@redhat.com>
  7884. * gimplify.c (gimplify_function_tree): Move gimplification of the
  7885. function body ...
  7886. (gimplify_body): ... here.
  7887. * tree-simple.h (gimplify_body): Declare.
  7888. * tree-inline.c (initialize_inlined_parameters): If the
  7889. emitted assignment is not in GIMPLE form, gimplify the
  7890. body of assignments emitted.
  7891. 2003-07-17 Jeff Law <law@redhat.com>
  7892. * tree-dfa.c (remove_phi_arg): Update PHI_ARG_CAPACITY.
  7893. * tree-ssa.c (mark_def_sites): Do not build the dominator tree here.
  7894. (rewrite_into_ssa): Do not depend on mark_def_sites to build the
  7895. dominator tree. Move computation of dominance frontiers out
  7896. of main loop (even though it was only done once). Free immediate
  7897. dominator information as soon as we're done with it.
  7898. * tree-flow.h (remove_phi_nodes_and_edges_for_unreachable_block):
  7899. Prototype.
  7900. * tree-cfg.c (remove_phi_nodes_and_edges_for_unreachable_block): New
  7901. function extracted from remove_bb.
  7902. (remove_bb): Call remove_phi_nodes_and_edges_for_unreachable_block.
  7903. * tree-ssa-dom.c (optimize_block): Propagate values into PHI nodes.
  7904. Do not optimize a block which has become unreachable.
  7905. If a COND_EXPR has a compile-time constant condition, then remove
  7906. outgoing from the COND_EXPR which can not execute.
  7907. 2003-07-16 Frank Ch. Eigler <fche@redhat.com>
  7908. * tree-mudflap.c (mx_xfn_indirect_ref): Correct source locations
  7909. for tracked expressions by ignoring incidental decl source loci.
  7910. 2003-07-16 Jeff Law <law@redhat.com>
  7911. * tree-cfg.c (remove_bb): Remove statements in reverse order.
  7912. Simplify code to issue warnings for unreachable code.
  7913. * tree-ssa-dom.c (get_eq_expr_value): Also enter expressions
  7914. into the available expression hash table. Callers changed to
  7915. pass in the block_avail_exprs varray and const_and_copies hash
  7916. table.
  7917. (optimize_stmt): Allow optimization of the condition in
  7918. a COND_EXPR statement.
  7919. (lookup_avail_expr): For COND_EXPRs, just see if their condition
  7920. has been recorded into the hash table, do not enter them into
  7921. the hash table. Only do a lookup of the result in the
  7922. const_and_copies table if it is an SSA_VAR.
  7923. (avail_expr_hash): Handle COND_EXPRs, specifically we only care
  7924. about their condition and virtual operands.
  7925. (avail_expr_eq): Likewise. If one statement has virtual operands
  7926. and the other does not, then the expressions are not equal.
  7927. * tree-ssa.c (rewrite_into_ssa): If we have done dominator
  7928. optimizations, then call cleanup_tree_cfg after rewriting is
  7929. complete.
  7930. * tree-ssa-dom.c (optimize_block): Get eq_expr_value for the
  7931. current block rather than having it passed in by the caller.
  7932. Propagate eq_expr_value into the false arm of a COND_EXPR.
  7933. (get_eq_expr_value): Return equivalences for the false
  7934. arm of a COND_EXPR if requested.
  7935. 2003-07-16 Daniel Berlin <dberlin@dberlin.org>
  7936. * c-decl.c (store_parm_decls): Also strip NON_LVALUE_EXPRs and
  7937. CONVERT_EXPRs when setting DECL_NONLOCAL.
  7938. 2003-07-15 Daniel Berlin <dberlin@dberlin.org>
  7939. * tree-cfg.c (remove_stmt): Update bb->end_tree_p properly when
  7940. stmt_p is the end of the bb.
  7941. 2003-07-15 Jeff Law <law@redhat.com>
  7942. * tree-ssa-dom.c (optimize_stmt): Consider two types equivalent if
  7943. their TYPE_MAIN_VARIANT is equivalent.
  7944. (avail_expr_eq): Likewise.
  7945. * Makefile.in (OBJS): Add tree-ssa-dom.o
  7946. (tree-ssa-dom.o): Add dependencies.
  7947. (ssa.o, cfghooks.o): Use $(TREE_FLOW_H), not tree-flow.h.
  7948. * timevar.def: Add new timevar for dominator optimizer. Reorder
  7949. slightly.
  7950. * tree-dfa.c (add_stmt_operand): Do not consider references to
  7951. static storage as volatile operands.
  7952. (add_referenced_var): Static storage items reference global memory.
  7953. * tree-ssa.c: Simplify by moving everything specific to the
  7954. dominator optimizer into tree-ssa-dom.c. Call into the dominator
  7955. optimizer after rewriting all the basic blocks.
  7956. * tree-ssa-dom.c: New file. Mostly extracted from tree-ssa.c
  7957. * tree-flow.h (tree_ssa_dominator_optimize): Prototype.
  7958. (dump_dominator_optimization_stats): Likewise.
  7959. (debug_dominator_optimization_stats): Likewise.
  7960. 2003-07-15 Diego Novillo <dnovillo@redhat.com>
  7961. * tree-dfa.c (add_stmt_operand): Move volatile handling...
  7962. (find_vars_r): ... here.
  7963. Mark when the walker is inside an ASM_EXPR.
  7964. (struct walk_state): Add field 'is_asm_expr'.
  7965. Change flag fields to bitfields.
  7966. (add_referenced_var): If the variable is a pointer being stored by
  7967. an ASM_EXPR, mark it as a global memory pointer.
  7968. * tree-flow-inline.h (is_optimizable_addr_expr): New function.
  7969. * tree-flow.h (is_optimizable_addr_expr): Declare it.
  7970. * tree-ssa.c (rewrite_and_optimize_stmt): Use it.
  7971. (lookup_avail_expr): Likewise.
  7972. (get_eq_expr_value): Likewise.
  7973. (avail_expr_eq): Return 'true' when comparing a statement against
  7974. itself.
  7975. * tree-ssa-dce.c (need_to_preserve_store): Move volatile checking...
  7976. (stmt_useful_p): ...here.
  7977. 2003-07-15 Andreas Jaeger <aj@suse.de>
  7978. * c-simplify.c: Convert prototypes to ISO C90.
  7979. * gimplify.c: Likewise.
  7980. * simple-break-elim.c: Likewise.
  7981. * simple-goto-elim.c: Likewise.
  7982. * tree-alias-ander.c: Convert prototypes to ISO C90.
  7983. * tree-alias-common.c: Likewise.
  7984. * tree-alias-type.c: Likewise.
  7985. * tree-browser.c: Likewise.
  7986. * tree-dchain.c: Likewise.
  7987. * tree-mudflap.c: Likewise.
  7988. * tree-nomudflap.c: Likewise.
  7989. * tree-optimize.c: Likewise.
  7990. * tree-pretty-print.c: Likewise.
  7991. * tree-simple.c: Likewise.
  7992. * tree-alias-common.h: Convert prototypes to ISO C90, remove extra
  7993. whitespace.
  7994. * tree-alias-type.h: Convert prototypes to ISO C90.
  7995. * tree-dchain.h: Likewise.
  7996. * tree-flow-inline.h: Likewise.
  7997. * tree-flow.h: Likewise.
  7998. * tree-iterator.h: Likewise.
  7999. * tree-mudflap.h: Likewise.
  8000. * tree-simple.h: Likewise.
  8001. 2003-07-14 Daniel Berlin <dberlin@dberlin.org>
  8002. * tree-ssa-pre.c (tree_perform_ssapre): Fix dom_children after DCE
  8003. breaks them.
  8004. 2003-07-14 Diego Novillo <dnovillo@redhat.com>
  8005. * tree-dfa.c (add_vdef): Initialize variable 'vdef'.
  8006. (add_vuse): Initialize variable 'vuse'.
  8007. 2003-07-14 Diego Novillo <dnovillo@redhat.com>
  8008. Must alias analysis. Allow the SSA rename pass to be done on a set
  8009. of variables.
  8010. * Makefile.in (OBJS): Add tree-must-alias.o.
  8011. * flags.h (flag_tree_must_alias): Declare.
  8012. * timevar.def (TV_TREE_MUST_ALIAS): Define.
  8013. * toplev.c (flag_tree_must_alias): Declare.
  8014. (f_options): Add entry for -ftree-must-alias.
  8015. (parse_options_and_default_flags): Enable must-alias analysis at -O1.
  8016. * tree-cfg.c (remove_useless_stmts_and_vars): Do not remove
  8017. addressable variables.
  8018. * tree-dfa.c (dump_file, dump_flags): New local variables to
  8019. replace tree_ssa_dump_file and tree_ssa_dump_flags. Update every
  8020. user.
  8021. (get_stmt_operands): Clear the array of virtual operands before
  8022. scanning the statement.
  8023. (get_expr_operands): Do not add an operand for ADDR_EXPR if the
  8024. expression takes the address of a VAR_DECL or a PARM_DECL. Instead
  8025. add the variable to the list of variables whose address has been
  8026. taken by the statement.
  8027. Allow INDIRECT_REF expressions of the form *&VAR. Convert them
  8028. into an operand for VAR.
  8029. When processing function calls, add a VUSE for .GLOBAL_VAR if the
  8030. function is pure but not const.
  8031. (add_stmt_operand): If the operand is an ADDR_EXPR, add the
  8032. variable to the list of variables whose address has been taken by
  8033. the statement.
  8034. (add_vdef): If the statement had virtual definitions, try to find
  8035. an existing VDEF for the variable, to preserve SSA information. If
  8036. none is found, create a new one.
  8037. (add_vuse): Likewise.
  8038. (remove_all_phi_nodes_for): New function.
  8039. (get_call_flags): New function to replace call_may_clobber. Update
  8040. all callers.
  8041. * tree-dump.c (dump_files): Add entry for -fdump-tree-mustalias.
  8042. * tree-flow-inline.h (addresses_taken): New function.
  8043. (is_unchanging_value): New function.
  8044. * tree-flow.h (addresses_taken): Declare.
  8045. (remove_all_phi_nodes): Declare.
  8046. (init_tree_ssa): Declare.
  8047. (propagate_copy): Declare.
  8048. (is_unchanging_value): Declare.
  8049. (tree_compute_must_alias): Declare.
  8050. * tree-inline.c (copy_body_r): Fold instances of *&VAR.
  8051. * tree-must-alias.c: New file.
  8052. * tree-optimize.c (optimize_function_tree): Call init_tree_ssa and
  8053. compute_may_aliases before calling rewrite_into_ssa.
  8054. After the SSA pass, run dead code elimination and compute
  8055. must-aliases.
  8056. * tree-simple.c (is_gimple_call_expr): Add comment that
  8057. is_gimple_* predicates should not have side effects.
  8058. * tree-ssa-ccp.c: Replace calls to really_constant_p with
  8059. is_unchanging_value everywhere.
  8060. (fold_stmt): Don't fold if the RHS is already a constant.
  8061. * tree-ssa-copyprop.c (copyprop_stmt): Remove unnecessary
  8062. variable 'vuse'.
  8063. Call propagate_copy to replace the operand with its new value.
  8064. (copyprop_phi): Remove unnecessary variable 'vuse'.
  8065. (get_original): Remove unused parameter 'vuse_p'.
  8066. (propagate_copy): New function.
  8067. * tree-ssa-dce.c (need_to_preserve_store): Update comments.
  8068. * tree-ssa.c (dump_file, dump_flags): New local variables to
  8069. replace globals tree_ssa_dump_file and tree_ssa_dump_flags. Update
  8070. all users.
  8071. (addr_expr_propagated_p): New local variable.
  8072. (vars_to_rename): New local variable.
  8073. (check_for_new_variables): New local function.
  8074. (rewrite_into_ssa): Add new argument VARS which is a bitmap
  8075. representing all the variables that should be renamed into SSA. If
  8076. VARS is NULL, all the variables in the program are renamed.
  8077. Don't call init_tree_ssa nor compute_may_aliases.
  8078. Initialize all the local hash tables and bitmaps.
  8079. Add support for repeating the SSA rename process more than once.
  8080. If the dominator optimizations produced new symbols, repeat the
  8081. process.
  8082. (mark_def_sites): Ignore operands that are in SSA form already.
  8083. (insert_phi_nodes): Only add PHI nodes for variables in the
  8084. VARS_TO_RENAME bitmap.
  8085. (rewrite_block): Ignore PHI nodes that have been renamed already.
  8086. (rewrite_and_optimize_stmt): Ignore operands that are already in
  8087. SSA form.
  8088. When propagating ADDR_EXPR set addr_expr_propagated_p to 'true'.
  8089. Call propagate_copy when doing copy propagation.
  8090. Call is_unchanging_value to decide if the RHS of an assignment is a
  8091. constant.
  8092. (rewrite_stmt): Ignore operands that are already in SSA form.
  8093. (init_tree_ssa): Make external.
  8094. Move initialization of local hash tables and bitmaps to
  8095. rewrite_into_ssa.
  8096. (remove_annotations_r): Don't special case MODIFY_EXPR nodes.
  8097. (lookup_avail_expr): Call is_unchanging_value.
  8098. (get_eq_expr_value): Likewise.
  8099. * tree.h (enum tree_dump_index): Add TDI_must_alias.
  8100. * cp/optimize.c (optimize_function): Don't call the tree optimizers
  8101. if -fdisable-tree-ssa is given.
  8102. * doc/invoke.texi: Add documentation for -ftree-must-alias.
  8103. 2003-07-07 Jeff Law <law@redhat.com>
  8104. * fold-const.c (nondestructive_fold_unary_to_constant: For BIT_NOT_EXPR
  8105. make sure OP0 is a suitable constant before trying to fold it.
  8106. * tree-cfg.c (handle_switch_fallthru): Set DECL_CONTEXT for
  8107. newly created labels.
  8108. * tree-cfg.c (move_outgoing_edges): New function.
  8109. (merge_tree_blocks): Use it.
  8110. (remove_bb): Remove the block from the pdom_info structures
  8111. as well if they exist.
  8112. (linearize_cond_expr): Move important edges from the then and
  8113. else arms to BB as appropriately
  8114. * tree-cfg.c (remove_stmt): When removing a COMPOUND_EXPR, make
  8115. sure that any basic block pointers to the arms of the COMPOUND_EXPR
  8116. are updated.
  8117. * tree-cfg.c (make_goto_expr_edges): Computed gotos create
  8118. abnormal edges.
  8119. 2003-07-05 Daniel Berlin <dberlin@dberlin.org>
  8120. * tree-ssa-pre.c (defs_match_p): Check for copies of the same version.
  8121. 2003-07-03 Frank Ch. Eigler <fche@redhat.com>
  8122. * tree-nomudflap.c (mf_marked_p, mf_mark): New dummy functions.
  8123. 2003-07-03 Jeff Law <law@redhat.com>
  8124. * tree-ssa.c (lookup_avail_expr): Accept new argument containing the
  8125. const_and_copies table. All callers changed. If we find the
  8126. given expression in the availe expression hash table, then lookup
  8127. the LHS of the hash table's entry in the const_and_copies_table.
  8128. Do record type casts into the available expression table.
  8129. * tree-nomudflap.c (mf_marked_p): Mark arguments as being unused.
  8130. (mf_mark): Likewise.
  8131. * c-decl.c (store_parm_decls): Strip away NOP_EXPRs when looking
  8132. for hidden use variables.
  8133. 2003-07-02 Frank Ch. Eigler <fche@redhat.com>
  8134. * varasm.c (build_constant_desc): Propagate mudflap marked-ness
  8135. across constant copying.
  8136. 2003-07-02 Daniel Berlin <dberlin@dberlin.org>
  8137. * tree-ssa-pre.c (tree_perform_ssapre): Don't optimize things with
  8138. volatile ops or making aliased loads right now.
  8139. (create_expr_ref): Mark the phi result of the new phi as having
  8140. real refs.
  8141. (finalize_1): Mark the new temp as having real refs.
  8142. (repair_use_injury): Ditto.
  8143. (code_motion): Ditto.
  8144. 2003-07-01 Daniel Berlin <dberlin@dberlin.org>
  8145. * tree.h (struct tree_eref_common): Add injured flag.
  8146. Add EREF_INJURED macro.
  8147. 2003-07-01 Daniel Berlin <dberlin@dberlin.org>
  8148. * tree-flow-inline.h (stmt_ann): We have stmt_ann on E*_NODE's as well,
  8149. so use is_essa_node as well.
  8150. * tree-dfa.c (create_stmt_ann): Ditto.
  8151. * tree.h (is_essa_node): Declare.
  8152. * tree.c (is_essa_node): Define.
  8153. 2003-07-01 Jason Merrill <jason@redhat.com>
  8154. * tree-cfg.c (prepend_stmt_to_bb): New fn.
  8155. (bsi_insert_after): Add to the beginning of an empty block.
  8156. 2003-07-01 Jeff Law <law@redhat.com>
  8157. * expr.c (expand_expr, case COND_EXPR): Correctly (?) handle
  8158. cases where a containing block has a stack level. Handle
  8159. cases where one arm is a GOTO_EXPR and the other arm has
  8160. side effects.
  8161. * stmt.c (containing_blocks_have_cleanups_or_stack_level): New
  8162. function.
  8163. (any_pending_cleanups): Further simplification.
  8164. * tree.h (containing_blocks_have_cleanups_or_stack_level): Prototype.
  8165. 2003-06-30 Diego Novillo <dnovillo@redhat.com>
  8166. * tree-flow.h (struct tree_ann_common_d): Remove 'stmt' field.
  8167. Update all users.
  8168. (struct var_ann_d): Remove field 'has_real_refs'. Update all callers
  8169. with calls to SSA_NAME_HAS_REAL_REFS.
  8170. Remove field 'occurs_in_abnormal_phi'. Update all callers with
  8171. calls to SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
  8172. * tree-flow-inline.h (var_ann): Only accept _DECL nodes.
  8173. (stmt_ann): Only accept GIMPLE statements.
  8174. (tree_stmt): Remove. Update all users.
  8175. * tree-cfg.c (linearize_cond_expr): Handle cases where BB doesn't
  8176. have a postdominator.
  8177. (find_contained_blocks): Do not look inside COND_EXPR_COND nor
  8178. SWITCH_COND expressions.
  8179. * tree-dfa.c (get_stmt_operands): Force virtual operands on
  8180. ASM_EXPRs.
  8181. (get_expr_operands): Handle SSA names when adding operands for
  8182. memory tags.
  8183. (add_stmt_operand): Handle SSA names.
  8184. Move checks for volatile operands earlier in the code.
  8185. (add_vdef): Re-format for readability.
  8186. (create_var_ann): Only allow _DECL nodes.
  8187. (create_stmt_ann): Only allow GIMPLE statements.
  8188. (dump_variable): Handle SSA names.
  8189. (dump_may_aliases_for): Likewise.
  8190. (may_access_global_mem_p): Handle SSA names.
  8191. (remove_phi_arg): If the argument removed was the last one with
  8192. real references, update the LHS of the PHI node.
  8193. (add_phi_arg): If the argument added has real references, propagate
  8194. the attribute into the LHS of the PHI node.
  8195. * tree-pretty-print.c (dump_generic_node): Only retrieve basic
  8196. block information from GIMPLE statements.
  8197. Always output the THEN and ELSE clauses of COND_EXPR nodes.
  8198. * tree-simple.c (is_gimple_stmt): Accept PHI_NODEs.
  8199. (is_gimple_id): Accept SSA_NAMEs.
  8200. * tree-ssa-copyprop.c (copyprop_phi): If an argument is used as a
  8201. real operand, propagate the attribute into the LHS of the PHI.
  8202. * tree-ssa-live.c (create_ssa_var_map): Don't set 'used' flag on
  8203. both the operand and the result of VDEFs.
  8204. Only register PHI results and arguments that have been used as real
  8205. operands.
  8206. (calculate_live_on_entry): Fix formatting in debugging message.
  8207. * tree-ssa.c (register_new_def): Add new argument
  8208. 'is_real_operand'. If it's set, set SSA_NAME_HAS_REAL_REFS for the
  8209. new name. Update all callers.
  8210. (rewrite_operand): Add new argument 'is_real_operand'. If it's
  8211. set, set SSA_NAME_HAS_REAL_REFS to the operand.
  8212. (eliminate_build): Ignore PHI arguments and PHI results that have
  8213. not been used in real operands.
  8214. (rewrite_vdefs): Remove. Update all users.
  8215. (set_is_used): Don't handle SSA names.
  8216. (coalesce_ssa_name): Ignore PHI arguments that have not had real
  8217. references in the program.
  8218. * tree.c (make_ssa_name): Update documentation.
  8219. * tree.h (IS_EMPTY_STMT): Call integer_zerop instead of comparing
  8220. against size_zero_node.
  8221. (SSA_NAME_HAS_REAL_REFS): Define.
  8222. (SSA_NAME_OCCURS_IN_ABNORMAL_PHI): Define.
  8223. (struct tree_ssa_name): Add bitfields 'has_real_refs' and
  8224. 'occurs_in_abnormal_phi'.
  8225. 2003-06-30 Jeff Law <law@redhat.com>
  8226. * c-simplify.c (gimplify_c_loop): Don't return a LOOP_EXPR for
  8227. a do ... while (0) loop.
  8228. * expr.c (expand_expr, case COND_EXPR): Be smarter about expanding
  8229. a COND_EXPR with only one useful arm, which happens to be a GOTO_EXPR.
  8230. * tree-cfg.c (remove_useless_stmts_and_vars): Don't remove user
  8231. variables unless we're at -O2 or higher.
  8232. 2003-06-30 Daniel Berlin <dberlin@dberlin.org>
  8233. * tree-ssa-pre.c (expr_phi_insertion): Stop optimizing the expression
  8234. if we have > some very large number of ephi operands, as it will
  8235. take an ungodly amount of memory and time.
  8236. (pre_expression): Push/pop gc context so we can do gc collection
  8237. in between expressions.
  8238. Throw away expression info right after done optimizing it.
  8239. 2003-06-30 Jason Merrill <jason@redhat.com>
  8240. * gimplify.c (gimplify_call_expr): Check PUSH_ARGS_REVERSED.
  8241. * gimplify.c (gimplify_modify_expr): Also force a call with a
  8242. possible nonlocal goto into a temporary.
  8243. (gimplify_return_expr): Don't duplicate the MODIFY_EXPR.
  8244. * tree-iterator.h (tsi_one_before_end_p): New fn.
  8245. 2003-06-29 Jeff Sturm <jsturm@one-point.com>
  8246. * fold-const.c (fold): Don't save_expr unless TREE_SIDE_EFFECTS.
  8247. 2003-06-26 Diego Novillo <dnovillo@redhat.com>
  8248. * c-simplify.c (gimplify_stmt_expr): Handle statement-expressions
  8249. that don't end in a non-void expression. Emit a warning in that
  8250. case.
  8251. 2003-06-26 Daniel Berlin <dberlin@dberlin.org>
  8252. * tree-ssa-pre.c (fixup_domchildren): Rename from
  8253. compute_domchildren, change to not use our own array.
  8254. (domchildren): Remove variable.
  8255. (insert_occ_in_preorder_dt_order_1): Use dom_children now.
  8256. (insert_euse_in_preorder_dt_order_1): Ditto.
  8257. (search_dt_preorder): Ditto.
  8258. (handle_bb_creation): Fix to work properly.
  8259. (tree_perform_ssapre): Remove remnants of domchildren.
  8260. Redo dominator info if we have to due to a new block.
  8261. 2003-06-26 Andrew MacLeod <amacleod@redhat.com>
  8262. * tree-cfg.c (handle_switch_split): Use a tree iterator to find the
  8263. real split point rather than a block iterator.
  8264. 2003-06-26 Jason Merrill <jason@redhat.com>
  8265. * tree-simple.c (is_gimple_stmt): Complete.
  8266. 2003-06-24 Jeff Law <law@redhat.com>
  8267. * tree-cfg.c (remove_useless_stmts_and_vars): On the first
  8268. iteration, remove unused variables from BIND_EXPRs.
  8269. * tree-flow.h (var_ann_d): Add new field USED.
  8270. (set_is_used): Prototype.
  8271. (remove_useless_stmts_and_vars): Update prototype.
  8272. * tree-ssa-live.c (create_ssa_var_map): Note which variables
  8273. are used so that we can delete those which are not used.
  8274. * tree-ssa.c (create_temp): Mark the new temporary as being used.
  8275. (rewrite_out_of_ssa): Note if the call to remove_useless_stmts_and_vars
  8276. is the first iteration or not.
  8277. (set_is_used): New function.
  8278. * c-decl.c (store_parm_decls): Variables and parameters on the
  8279. pending_sizes chain have nonlocal uses.
  8280. 2003-06-25 Daniel Berlin <dberlin@dberlin.org>
  8281. * tree-ssa-pre.c: Convert to ISO C.
  8282. (handle_bb_creation): New function.
  8283. (ephi_will_be_avail): Remove dead code.
  8284. (finalize_1): Use handle_bb_creation, start to fix edge insertion
  8285. related fun.
  8286. (maybe_find_rhs_use_for_var): Stop using tree_stmt.
  8287. (code_motion): Always get the temporary from the right place.
  8288. 2003-06-24 Jason Merrill <jason@redhat.com>
  8289. * gimplify.c (gimplify_self_mod_expr): Add want_value parm.
  8290. For postfix ops, make sure it returns an rvalue.
  8291. (gimplify_expr): Copy a volatile reference into a temp.
  8292. (create_tmp_var): Require a complete type.
  8293. (create_tmp_alias_var): Use TYPE_VOLATILE on types.
  8294. * tree-simple.c (is_gimple_stmt): Flesh out a bit.
  8295. (is_gimple_val): Don't allow volatiles.
  8296. * c-simplify.c (gimplify_expr_stmt): Don't insert a null pointer.
  8297. * gimplify.c (gimplify_return_expr): Search through the gimple
  8298. form for the interesting MODIFY_EXPR.
  8299. (gimplify_modify_expr): Don't suppress posteffects if want_value.
  8300. 2003-06-24 Diego Novillo <dnovillo@redhat.com>
  8301. * tree-dfa.c (struct dfa_stats_d): Remove obsolete fields
  8302. num_tree_refs and size_tree_refs. Update all users.
  8303. (dump_dfa_stats): Also dump information about VUSE and VDEF
  8304. operands.
  8305. * tree-ssa.c (rewrite_vdefs): Dump information about VDEF operators
  8306. promoted to real copies if -fdump-tree-optimized-details is given.
  8307. 2003-06-23 Jeff Law <law@redhat.com>
  8308. * tree-ssa.c (avail_expr_eq): Verify types are the same before
  8309. handing expressions to operand_equal_p.
  8310. * tree-cfg.c (make_edges): Remove fake edges before building
  8311. extra edges for TRY_FINALLY_EXPRs. Delete unnecessary edges
  8312. leaving the TRY block in a TRY_FINALLY_EXPR.
  8313. (find_contained_blocks): Don't consider statements in the CATCH
  8314. clause of a TRY_CATCH_EXPR when noting the last statement in
  8315. the block.
  8316. * tree-dfa.c (remove_phi_arg): If we removed the last PHI argument,
  8317. then remove the entire PHI node.
  8318. * tree-ssa-dce.c (stmt_useful_p): Consider the other EH related
  8319. nodes useful as well (TRY_FINALLY_EXPR, TRY_CATCH_EXPR, and
  8320. EH_FILTER_EXPR).
  8321. * tree-cfg.c (remove_useless_stmts_and_vars): If the body of a
  8322. TRY_CATCH_EXPR is empty, then the entire TRY_CATCH_EXPR can
  8323. be safely removed.
  8324. * tree-cfg.c (find_contained_blocks): Renamed from
  8325. find_contained_blocks_and_edge_targets. Remove targets
  8326. bitmap argument and no longer record targets of edges.
  8327. All callers changed.
  8328. (make_edges): No longer need TRY_TARGETS bitmap. Kill it.
  8329. Simplify code which creates additional edges out of the TRY
  8330. block and the FINALLY block in a TRY_FINALLY_EXPR.
  8331. 2003-06-23 Diego Novillo <dnovillo@redhat.com>
  8332. * tree-alias-common.c (ptr_may_alias_var): Don't handle memory
  8333. tags.
  8334. * tree-dfa.c (struct alias_set_d): Remove. Update all users.
  8335. (alias_sets): Remove. Update all users.
  8336. (struct walk_state): Remove field aliased_objects_found.
  8337. (struct alias_map_d): New.
  8338. (addressable_vars): New local variable.
  8339. (pointers): New local variable.
  8340. (add_stmt_operand): Do not force aliased variables to be in virtual
  8341. operands.
  8342. (register_alias_set): Remove. Update all users.
  8343. (find_alias_for): Remove. Update all users.
  8344. (get_memory_tag_for): New local function.
  8345. (num_referenced_vars): Remove.
  8346. (num_aliased_objects): Remove. Update all users.
  8347. (aliased_objects): Remove. Update all users.
  8348. (aliased_objects_alias_set): Remove. Update all users.
  8349. (num_call_clobbered_vars): Remove. Update all users.
  8350. (dump_variable): Move code to dump aliases ...
  8351. (dump_may_aliases_for): ... here.
  8352. (debug_may_aliases_for): New function.
  8353. (compute_may_aliases): Initialize 'addressable_vars' and 'pointers'
  8354. arrays.
  8355. (compute_alias_sets): Re-implement matching pointers with
  8356. addressable variables. Limit the size of may-alias sets.
  8357. (may_alias_p): Re-implement to compare pointers against variables,
  8358. instead of memory tags.
  8359. (dump_alias_info): Re-implement to display pointers and addresable
  8360. variables arrays.
  8361. (add_referenced_var): Collect addressable variables and pointers.
  8362. Share memory tags among pointers that may alias each other.
  8363. * tree-flow.h (num_referenced_vars): Change to macro.
  8364. (referenced_var): Likewise.
  8365. (num_call_clobbered_vars): Likewise.
  8366. (call_clobbered_var): Likewise.
  8367. (dump_may_aliases_for): Declare.
  8368. (debug_may_aliases_for): Declare.
  8369. * tree-ssa.c (rewrite_vdefs): New local function.
  8370. (rewrite_out_of_ssa): Call it.
  8371. 2003-06-23 Jeff Law <law@redhat.com>
  8372. * tree-cfg.c (make_edges): Walk TRY_FINALLYs inner to outer and
  8373. simplify creation of special edges related to the TRY_FINALLY_EXPR.
  8374. * tree-cfg.c (remove_useless_stmts_and_vars): More aggressively
  8375. remove TRY_CATCH_EXPRs and TRY_FINALLY_EXPRs.
  8376. * tree-cfg.c (make_edges): Remove fake edges.
  8377. (make_exit_edges): Mark edges from nonreturning functions to the
  8378. exit block as being fake edges.
  8379. * gimplify.c (gimplify_modify_expr): Don't create a new MODIFY_EXPR,
  8380. reuse the existing one.
  8381. 2003-06-23 Andrew MacLeod <amacleod@redhat.com>
  8382. * tree-cfg.c (find_insert_location): Default case should insert after
  8383. the last stmt in the block.
  8384. 2003-06-22 Jeff Sturm <jsturm@one-point.com>
  8385. * Makefile.in (old-tree-inline.o): Remove rule.
  8386. * old-tree-inline.c: Remove.
  8387. 2003-06-19 Jeff Law <law@redhat.com>
  8388. * tree-cfg.c (make_ctrl_stmt_edges): Do not create bogus edges
  8389. to the successor block of TRY_CATCH_EXPR, TRY_FINALLY_EXPR,
  8390. CATCH_EXPR or EH_FILTER_EXPR nodes.
  8391. * gimplify.c (gimplify_modify_expr): If the RHS of an MODIFY_EXPR
  8392. might throw, then make sure its result goes into a temporary.
  8393. * tree-cfg.c (handle_switch_split): Handle case where target
  8394. block has only one statement (the case label itself).
  8395. 2003-06-19 Diego Novillo <dnovillo@redhat.com>
  8396. * doc/invoke.texi: Add documentation for -ftree-dominator-opts
  8397. that was missing from an earlier patch.
  8398. 2003-06-19 Jeff Sturm <jsturm@one-point.com>
  8399. * gimplify.c (gimplify_expr): Handle LABELED_BLOCK_EXPR
  8400. and EXIT_BLOCK_EXPR.
  8401. (gimplify_labeled_block_expr): New function.
  8402. (gimplify_exit_block_expr): New function.
  8403. 2003-06-18 Andrew MacLeod <amacleod@redhat.com>
  8404. * tree-cfg.c (EDGE_INSERT_LOCATION_BSI_AFTER): New location code.
  8405. (cleanup_switch_expr_graph): Find default case correctly.
  8406. (bsi_insert_after): Get BB from stmt when its avialble.
  8407. (bsi_insert_before): Get BB from stmt when its avialble.
  8408. (handle_switch_fallthru): New. Handle edge from switch to the fallthru.
  8409. (handle_switch_split): Re-implement using new scheme.
  8410. (find_insert_location): Use handle_switch_fallthru ().
  8411. (bsi_insert_on_edge_immediate): Handle EDGE_INSERT_LOCATION_BSI_AFTER.
  8412. * tree-iterator.h (tsi_last): New. Find last stmt in a chain.
  8413. 2003-06-17 Daniel Berlin <dberlin@dberlin.org>
  8414. * tree-alias-common.c (find_func_aliases): Guard cast op
  8415. properly.
  8416. (ptr_may_alias_var): Small optimization to avoid calling
  8417. decl_function_context so often.
  8418. * tree-alias-ander.c (ander_simple_assign): Ignore if lhs == rhs.
  8419. 2003-06-17 Steven Bosscher <steven@gcc.gnu.org>
  8420. * timevar.def (TV_TREE_BUILD_FUD_CHAINS): Remove.
  8421. 2003-06-16 Diego Novillo <dnovillo@redhat.com>
  8422. * tree-ssa-ccp.c (DONT_SIMULATE_AGAIN): Define.
  8423. (visit_phi_node): Don't do anything if the PHI node doesn't need to
  8424. be simulated.
  8425. If the PHI variable does not have real references, consider it
  8426. VARYING.
  8427. If the PHI node has a lattice value of VARYING, set
  8428. DONT_SIMULATE_AGAIN.
  8429. (visit_stmt): Don't do anything if the statement doesn't need to be
  8430. simulated.
  8431. Only visit conditional branches COND_EXPR and SWITCH_EXPR.
  8432. If the statement doesn't produce a result mark it with
  8433. DONT_SIMULATE_AGAIN.
  8434. (visit_assignment): Remove unnecessary def_op() check.
  8435. If the value is VARYING, mark the statement with
  8436. DONT_SIMULATE_AGAIN.
  8437. (visit_cond_stmt): Remove unnecessary is_ctrl_stmt() check.
  8438. If the predicate is VARYING, mark the statement with
  8439. DONT_SIMULATE_AGAIN.
  8440. (initialize): Clear DONT_SIMULATE_AGAIN flag for every statement
  8441. and PHI node.
  8442. (likely_value): Get statement operands after checking if it makes
  8443. aliased loads or has volatile operands.
  8444. 2003-06-16 Jeff Law <law@redhat.com>
  8445. Jason Merrill <jason@redhat.com>
  8446. * except.c (enum eh_region_type): Don't declare the enumeration
  8447. members here. Instead do it in except.h.
  8448. (expand_eh_hander): Use expr_first instead of open-coding it.
  8449. * except.h (enum eh_region_type): Define the enumeration memebers
  8450. here.
  8451. * tree-cfg.c (last_exec_block): Break out from make_edges.
  8452. (could_trap_p): No longer static.
  8453. (get_eh_region_type): New function.
  8454. (make_try_expr_blocks): Keep the whole TRY_CATCH_EXPR or
  8455. TRY_FINALLY_EXPR instead of just the handler part in the
  8456. EH_STACK varray. For a cleanup, record which cleanup higher
  8457. in the EH_STACK it can reach.
  8458. (make_edges): Use last_exec_block.
  8459. (make_ctrl_stmt_edges): Thread cleanups as needed.
  8460. (compute_reachable_eh): Use get_eh_region_type. Properly
  8461. track when we can skip cleanups. Skip cleanups when possible.
  8462. * tree-flow.h (could_trap_p): Prototype.
  8463. 2003-06-16 Andrew Macleod <amacleod@redhat.com>
  8464. * tree-cfg.c (find_insert_location): Check for control_altering stmts,
  8465. and abort if its an unrecognized BB ending stmt.
  8466. (bsi_commit_first_edge_insert): Rename to bsi_insert_on_edge_immediate,
  8467. externalize, and change the interface to an on-demand inserter.
  8468. (bsi_commit_edge_inserts): Call bsi_insert_on_edge_immediate().
  8469. * tree-flow.h (bsi_insert_on_edge_immediate): Prototype.
  8470. * tree-pretty-print.c (dump_block_info): Add 'ab' for abnormal edges.
  8471. * tree-ssa-dce.c (process_worklist): Use sparse bitmaps.
  8472. * tree-ssa-live.c (calculate_live_on_entry): Abort if ssa_name has a
  8473. definition, but is also live on entry.
  8474. * tree-ssa.c (coalesce_ssa_name): Call abort() instead of error(), and
  8475. provide more detailed info.
  8476. (rewrite_out_of_ssa): Provide CFG dumps before and after rewritting.
  8477. 2003-06-16 Frank Ch. Eigler <fche@redhat.com>
  8478. * tree-mudflap.c (mf_mark): Use GC-compatible htab_create_ggc.
  8479. 2003-06-15 Jeff Law <law@redhat.com>
  8480. * tree-ssa-ccp.c (visit_phi_node): If the PHI is already known
  8481. to be varying, don't recompute its value.
  8482. 2003-06-14 Jeff Law <law@redhat.com>
  8483. Jason Merrill <jason@redhat.com>
  8484. * tree-cfg.c (make_blocks): Do not return early if presented
  8485. with an empty statement.
  8486. (make_ctrl_stmt_edges): Do not try to optimize an empty TRY
  8487. block in a TRY_FINALLY_EXPR. Simplify TRY_FINALLY_EXPR,
  8488. TRY_CATCH_EXPR, CATCH_EXPR, and EH_FILTER_EXPR now that empty
  8489. statements are no longer shared.
  8490. 2003-06-14 Kazu Hirata <kazu@cs.umass.edu>
  8491. * tree-ssa-pre.c: Fix a comment typo.
  8492. 2003-06-13 Diego Novillo <dnovillo@redhat.com>
  8493. * tree-dfa.c (get_stmt_operands): Abort if the statement is a
  8494. variable.
  8495. (create_var_ann): Abort if the variable is not a _DECL node.
  8496. 2003-06-13 Frank Ch. Eigler <fche@redhat.com>
  8497. * tree-mudflap.c (mudflap_c_function): Change calling conventions so
  8498. as to return the instrumented function body rather than changing the
  8499. given fndecl in place. Gimplify at the very end, for cosmetic
  8500. reasons.
  8501. * tree-mudflap.h, tree-nomudflap.c: Corresponding changes.
  8502. * c-decl.c (c_expand_body_1): Call mudflap_c_function just before
  8503. rtl expansion of function body; don't interfere with inlining.
  8504. 2003-06-13 Diego Novillo <dnovillo@redhat.com>
  8505. * c-simplify.c: Fix typo in previous change.
  8506. 2003-06-13 Diego Novillo <dnovillo@redhat.com>
  8507. * c-common.c, c-common.h, c-decl.c, c-lang.c, c-simplify.c,
  8508. flags.h, gimplify.c, langhooks-def.h, langhooks.c, langhooks.h,
  8509. simple-break-elim.c, simple-goto-elim.c, toplev.c,
  8510. tree-alias-common.c, tree-cfg.c, tree-dfa.c, tree-dump.c,
  8511. tree-inline.c, tree-mudflap.c, tree-simple.c, tree-simple.h,
  8512. tree-ssa-ccp.c, tree-ssa-pre.c, tree-ssa.c, tree.h, doc/invoke.texi:
  8513. Rename SIMPLE to GIMPLE everywhere.
  8514. 2003-06-13 Andrew MacLeod <amacleod@redhat.com>
  8515. * tree-cfg.c (bsi_commit_first_edge_insert): Only consider non-abnormal
  8516. edges when determining whether an edge needs to be split.
  8517. * tree-ssa-dce.c (process_worklist): When checking for GOTO and
  8518. COND_EXPR's that are necessary, check each BB's predecessors only once.
  8519. 2003-06-12 Jeff Law <law@redhat.com>
  8520. * tree-ssa.c (avail_expr_eq): Add some checking code to
  8521. detect when equal expressions have different hash values.
  8522. * tree.c (iterative_hash_expr): Don't hash types associated
  8523. with conversions. Instead hash on the signedness of the
  8524. toplevel object and the operand of the conversion.
  8525. * Makefile.in (gimplify.o): Depend on $(RTL_H). Ugh.
  8526. * gimplify.c: Include "rtl.h".
  8527. (simplify_call_expr): Use call_expr_flags and check for ECF_CONST
  8528. rather than checking bits in the tree node directly.
  8529. * fold-const.c (operand_equal_p): CALL_EXPRs with side effects
  8530. are never equal.
  8531. 2003-06-11 Frank Ch. Eigler <fche@redhat.com>
  8532. * gcc.c (MFWRAP_SPEC): Always wrap main().
  8533. * tree-mudflap.c (mudflap_enqueue_decl): Mark enqueued decls
  8534. to prevent their repeated processing.
  8535. 2003-06-11 Daniel Berlin <dberlin@dberlin.org>
  8536. * tree-ssa-pre.c: add graph_dump_file, graph_dump_flags.
  8537. (finalize_1): Modify to use temporary in expr_info structure,
  8538. remove temporary from arguments.
  8539. Use bsi_insert_on_edge for ephi insertions.
  8540. Set EREF_TEMP on inserted euses.
  8541. (repair_phi_injury): Note (to dump file) injuries we have
  8542. repaired already.
  8543. (repair_use_injury): Ditto.
  8544. (repair_euse_injury): Ditto.
  8545. (count_stmts_in_bb): Count both forwards and backwards, and make
  8546. sure the numbers agree. This makes sure both the head and end are
  8547. updated properly.
  8548. (code_motion): Use the EREF_TEMP, rather than calculating the
  8549. reaching def, when possible, because it's faster.
  8550. Add the phi we created when we insert the ephi. We should always
  8551. be able to get the reaching def of the ephi from EREF_TEMP (since
  8552. the args should have already been inserted, or in the case of
  8553. phi's, have a phi already allocated), so abort if we can't.
  8554. (create_expr_ref): Take expr_info parameter. Make a phi for the
  8555. ephi's, but don't add to the bb yet. Update all callers.
  8556. (get_default_def): New function.
  8557. (get_reaching_def): Use it to find the default def when we hit the
  8558. top of the dom tree.
  8559. (struct expr_info): Add temp.
  8560. (new_rename_1): Dump out occurrences after rename 1, but before
  8561. rename 2.
  8562. (requires_edge_placement): Now that we can insert on edges, we
  8563. shouldn't need this, so make it always return false.
  8564. Will remove unless something bad comes up.
  8565. (pre_expression): Start working on dumping the redundancy graph.
  8566. * tree.h (struct treeeref_common): Add the temp member.
  8567. Add EREF_TEMP macro.
  8568. (tree_dump_index): Reorder to match actual optimization order.
  8569. Add TDI_predot.
  8570. * tree-dump.c: Ditto.
  8571. 2003-06-11 Jeff Law <law@redhat.com>
  8572. * gimplify.c (simplify_call_expr): Clear TREE_SIDE_EFFECTS for
  8573. calls to "const" functions.
  8574. * tree-inline.c (expand_call_inline): Recalculate TREE_SIDE_EFFECTS
  8575. properly when inlining gimplified functions.
  8576. * fold-const.c (operand_equal_p): Handle CALL_EXPRs.
  8577. * tree-cfg.c (first_exec_block): Kill.
  8578. (make_edges): Use bb_for_stmt rather than first_exec_block.
  8579. (make_ctrl_stmt_edges, make_exit_edges): Likewise.
  8580. (make_loop_expr_edges, make_cond_expr_edges): Likewise.
  8581. (successor_block): Don't skip empty statements.
  8582. * tree-ssa.c (rewrite_and_optimize_stmt): Do not special case
  8583. CALL_EXPRs they're caught by the TREE_SIDE_EFFECTS test.
  8584. * tree-ssa.c (rewrite_and_optimize_stmt): Improve/correct setting of
  8585. may_optimize_p. Simplify later code knowing may_optimize_p is
  8586. correctly set.
  8587. (avail_expr_hash): Do not use iterative_hash_object or deal with
  8588. SSA names for real operands. Instead use iterative_hash_expr
  8589. which handles both.
  8590. (avail_expr_eq): Use operand_equal_p to test for equality.
  8591. 2003-06-11 Steven Bosscher <steven@gcc.gnu.org>
  8592. * tree-flow.h, tree-ssa-ccp.c, tree-ssa-copyprop.c,
  8593. tree-ssa-dce.c, tree-ssa-live.c, tree-ssa-live.h:
  8594. Convert function prototypes to ISO C.
  8595. 2003-06-10 Jeff Law <law@redhat.com>
  8596. * toplev.c (parse_options_and_default_flags): Fix typo in last change.
  8597. * gimplify.c (simplify_expr, case BIT_FIELD_REF): Make sure
  8598. to call recalculate_side_effects after gimplifying the
  8599. operands.
  8600. 2003-06-10 Diego Novillo <dnovillo@redhat.com>
  8601. * toplev.c (flag_tree_dom): New variable.
  8602. (f_options): Add new entry for -ftree-dominator-opts.
  8603. (parse_options_and_default_flags): Enable flag_tree_dom for
  8604. -O1 and higher. At -O2 and higher, disable flag_tree_dom is
  8605. SSA-PRE is also specified.
  8606. * flags.h (flag_tree_dom): Declare.
  8607. * doc/invoke.texi: Document -ftree-dominator-opts.
  8608. * tree-ssa.c (rewrite_block): Disable tracking of available
  8609. expressions when not doing dominator optimizations.
  8610. Call rewrite_stmt when not doing dominator optimizations.
  8611. Otherwise, call rewrite_and_optimize_stmt.
  8612. (rewrite_stmt): Don't optimize the statement. Just rename.
  8613. (rewrite_and_optimize_stmt): Optimize the statement while rewriting
  8614. its operands.
  8615. (lookup_avail_expr): Update comments.
  8616. 2003-06-10 Andrew Haley <aph@redhat.com>
  8617. * c-simplify.c (c_simplify_stmt): case ASM_STMT: Ensure qualifiers
  8618. come from input statement.
  8619. 2003-06-09 Andrew MacLeod <amacleod@redhat.com>
  8620. * tree-cfg.c (handle_switch_split): Update PHI nodes when splitting.
  8621. (tree_split_edge): Update PHI nodes in destination block.
  8622. 2003-06-09 Steven Bosscher <steven@gcc.gnu.org>
  8623. * basic-block.h, tree-dfa.c, tree-ssa.c, tree-cfg.c,
  8624. tree-flow.h: Convert function prototypes to ISO C.
  8625. 2003-06-09 Daniel Berlin <dberlin@dberlin.org>
  8626. * tree-cfg.c (bsi_commit_edge_inserts): Fix computation of
  8627. new_blocks.
  8628. 2003-06-08 Diego Novillo <dnovillo@redhat.com>
  8629. * tree-cfg.c (handle_switch_split): Don't allocate basic block
  8630. annotations more than once.
  8631. (bsi_commit_first_edge_insert): Likewise.
  8632. 2003-06-07 Jeff Sturm <jsturm@one-point.com>
  8633. * tree-cfg.c (could_trap_p): New function.
  8634. (stmt_ends_bb_p): Handle flag_non_call_exceptions.
  8635. (make_exit_edges): Handle flag_non_call_exceptions.
  8636. (is_ctrl_altering_stmt): Handle flag_non_call_exceptions.
  8637. * tree-inline.c (walk_tree): Add case for CHAR_TYPE.
  8638. * tree-ssa-dce.c (stmt_useful_p): Keep all CATCH_EXPRs.
  8639. 2003-06-05 Jason Merrill <jason@redhat.com>
  8640. * stmt.c (asm_op_is_mem_input): New fn.
  8641. * tree.h: Declare it.
  8642. * gimplify.c (simplify_asm_expr): Call resolve_asm_operand_names.
  8643. Use is_simple_modify_expr_lhs for mem input ops.
  8644. 2003-06-05 Frank Ch. Eigler <fche@redhat.com>
  8645. * c-mudflap.c (mflang_register_call): Give the synthetic decl
  8646. undefined (not zero) size.
  8647. 2003-06-05 Frank Ch. Eigler <fche@redhat.com>
  8648. * tree-mudflap.c (mx_flag): Remove. Update callers to use mf_mark.
  8649. (TREE_MUDFLAPPED_P): Remove. Update callers to use mf_marked_p.
  8650. (mf_mark, mf_marked_p): Replacement functions to replace old node
  8651. marking based on tree flag-bits.
  8652. (mf_mostly_copy_tree_r): Preserve markedness across copies.
  8653. * tree-mudflap.h: Add new decls
  8654. * c-mudflap.c (mx_flag): Remove. Update callers to use mf_mark.
  8655. 2003-06-04 Diego Novillo <dnovillo@redhat.com>
  8656. * tree-dfa.c (add_stmt_operand): Always consider non-scalar types
  8657. virtual operands.
  8658. 2003-06-04 Andrew MacLeod <amacleod@redhat.com>
  8659. * toplev.c (parse_options_and_default_flags): Turn tree_copyprop on by
  8660. default.
  8661. * tree-cfg.c (linearize_control_structures, linearize_cond_expr,
  8662. replace_stmt, merge_tree_blocks, remap_stmts): Fix PROTOS.
  8663. (find_insert_location): Add additional basic block parameter. Handle
  8664. switch stmts.
  8665. (handle_switch_split): New. Split edges to switch labels.
  8666. (bsi_commit_first_edge_insert): Add extra parameter to
  8667. find_insert_location call. Fix split block chaining in THEN & ELSE.
  8668. * tree-ssa-live.c (calculate_live_on_entry): Process all PHI def's
  8669. after all the arguments have been processed.
  8670. * tree-ssa.c (struct ssa_stats_d, struct loops *loops, var_is_live,
  8671. rewrite_into_ssa): Remove old UNSSA code.
  8672. (rewrite_block): Remove stmt is rewrite_stmt returns 1.
  8673. (assign_vars): Remove abort and enable overlapping live ranges.
  8674. (replace_variable): New. Replace SSA name with the partition variable.
  8675. (rewrite_out_of_ssa): Use replace_variable().
  8676. (dump_tree_ssa_stats): Remove old UNSSA code.
  8677. (rewrite_stmt): Return 1 if stmt should be deleted. Remove old
  8678. UNSSA code.
  8679. 2003-06-03 Diego Novillo <dnovillo@redhat.com>
  8680. * gimplify.c (simplify_call_expr): Move code to mark MD builtins
  8681. non-simplifiable...
  8682. * tree-simple.c (is_simple_call_expr): ... here.
  8683. 2003-06-03 Diego Novillo <dnovillo@redhat.com>
  8684. * c-parse.in: Fix botched merge.
  8685. 2003-06-03 Diego Novillo <dnovillo@redhat.com>
  8686. * tree-mudflap.c (MARK_TREE_MUDFLAPPED, TREE_MUDFLAPPED):
  8687. Use TREE_VISITED instead of TREE_BOUNDED.
  8688. * c-mudflap.c (TREE_MUDFLAPPED): Likewise.
  8689. * tree-pretty-print.c (dump_generic_node): Remove
  8690. references to TYPE_QUAL_BOUNDED.
  8691. 2003-06-03 Jason Merrill <jason@redhat.com>
  8692. * gimplify.c (simplify_cond_expr): Call truthvalue_conversion
  8693. before invert_truthvalue.
  8694. 2003-06-02 Daniel Berlin <dberlin@dberlin.org>
  8695. * tree-dfa.c (compute_may_aliases): Call delete_alias_vars whenever we
  8696. call create_alias_vars.
  8697. * tree-alias-common (ptr_may_alias_var): Cleanup determination of
  8698. global vars and whatnot.
  8699. 2003-06-02 Diego Novillo <dnovillo@redhat.com>
  8700. * Makefile.in (tree-ssa.o, tree-cfg.o): Add dependency on cfgloop.h
  8701. (tree-optimize.o): Remove dependency on cfgloop.h.
  8702. * basic-block.h (struct basic_block_def): Fix documentation for
  8703. field 'loop_father'.
  8704. * tree-dfa.c (add_referenced_var): Fix type of element
  8705. pushed into aliased_objects_alias_set.
  8706. * tree-optimize.c: Don't include cfgloop.h
  8707. (optimize_function_tree): Move code to initialize loop optimizer...
  8708. * tree-cfg.c (build_tree_cfg): ... here.
  8709. * tree-ssa.c: Include cfgloop.h.
  8710. (loops): New file local variable.
  8711. (rewrite_into_ssa): Initialize/finalize loop optimizer.
  8712. (rewrite_stmt): Call var_is_live when processing redundant
  8713. assignments to the same LHS.
  8714. (var_is_live): Add heuristic to discover overlapping definitions in
  8715. loops that do not have PHI nodes for VAR at the loop header.
  8716. 2003-06-02 Jason Merrill <jason@redhat.com>
  8717. * gimplify.c (simplify_expr): Only allow a cast from a 'val'.
  8718. * tree-simple.c (is_simple_cast): Likewise.
  8719. 2003-06-02 Andrew MacLeod <amacleod@redhat.com>
  8720. * tree-cfg.c (bsi_insert_before): Update end of block pointer if we
  8721. inserted before the last stmt in a block. (The container changed).
  8722. * tree-ssa.c (elim_backward): Inserting copy should be within
  8723. conditional check.
  8724. (elim_create): Only select one bit instead of the all.
  8725. 2003-06-01 Jason Merrill <jason@redhat.com>
  8726. * Makefile.in: Remove lots of -Wno-error targets.
  8727. * tree-simple.c (recalculate_side_effects): Check TREE_THIS_VOLATILE.
  8728. * gimplify.c (simplify_compound_lval): Call
  8729. recalculate_side_effects on each of the subexpressions.
  8730. * expr.c (expand_expr) <COND_EXPR>: Use the if-statement code if
  8731. it's void.
  8732. 2003-06-01 Daniel Berlin <dberlin@dberlin.org>
  8733. * tree-alias-common.c: Remove setting of DECL_CONTEXT in temp vars,
  8734. it's done in create_tmp_alias_var for us.
  8735. (ptr_may_alias_var): Check if the variables are memory tags, and get
  8736. the associated pointers if they are.
  8737. 2003-05-30 Frank Ch. Eigler <fche@redhat.com>
  8738. * tree-mudflap.c (mudflap_c_function, enqueue_constant, enqueue_decl):
  8739. Rework dumping logic.
  8740. 2003-05-27 Jason Merrill <jason@redhat.com>
  8741. * tree-ssa.c (avail_expr_hash): Simplify by using iterative_hash_expr
  8742. in more places.
  8743. * tree.c (iterative_hash_expr): Handle SSA_NAME.
  8744. 2003-05-29 Jeff Law <law@redhat.com>
  8745. * tree-ssa.c (rewrite_stmt): Detect and remove redundant
  8746. memory loads.
  8747. (avail_expr_hash): Use iterative_hash_expr, not iterative_hash_object
  8748. as needed.
  8749. 2003-05-27 Jason Merrill <jason@redhat.com>
  8750. * gimplify.c (shortcut_cond_expr): Avoid jumps to jumps.
  8751. 2003-05-26 Jason Merrill <jason@redhat.com>
  8752. * c-simplify.c (simplify_switch_stmt): A SWITCH_EXPR also gets the
  8753. source location of its first line.
  8754. 2003-05-24 Diego Novillo <dnovillo@redhat.com>
  8755. Do not consider INDIRECT_REF nodes to be variables.
  8756. * gimplify.c (create_tmp_alias_var): Allow temporaries of
  8757. ARRAY_TYPE to be created.
  8758. Create new temporaries with function scope.
  8759. Don't call build_type_variant.
  8760. Mark the temporary volatile if its type is volatile.
  8761. * tree-dfa.c: Change every function that received a variable and
  8762. its base symbol to just receive the variable. Update all callers.
  8763. (struct alias_set_d): Remove field 'tag_sym'.
  8764. Add documentation for fields.
  8765. (struct walk_state): Add field 'is_indirect_ref'.
  8766. Add documentation for fields.
  8767. (opf_ignore_bp): Remove. Update all users.
  8768. (aliased_objects_base): Remove. Update all users.
  8769. (get_stmt_operands): If the statement had virtual operands, do not
  8770. scan them again.
  8771. (get_expr_operands): Handle INDIRECT_REF nodes by adding an operand
  8772. for the memory tag represented and a use for the base pointer.
  8773. Don't add VUSE operands for pointer arguments to functions.
  8774. Force a virtual operand when processing ADDR_EXPR nodes.
  8775. (add_stmt_operand): If the variable is an alias tag, always add it
  8776. as a virtual operand.
  8777. Remove code to handle INDIRECT_REF nodes.
  8778. Move code to determine if a pointer may point to global memory to
  8779. find_vars_r.
  8780. Set has_volatile_ops flag in the statement when adding operands for
  8781. globals and local statics.
  8782. If the variable is an alias tag, mark the statement as making
  8783. aliased loads or stores.
  8784. (set_def): Mark the variable as having real references.
  8785. (add_use): Likewise.
  8786. (add_vdef): Remove code to re-add previous virtual operands.
  8787. If PREV_VOPS is set, don't add a new virtual operand.
  8788. (add_vuse): Likewise.
  8789. (dump_variable): Show annotation bitfields 'mem_tag',
  8790. 'occurs_in_abnormal_phi', 'is_alias_tag' and 'is_stored'.
  8791. (compute_may_aliases): Initialize walk_state.is_indirect_ref to 0.
  8792. (compute_alias_sets): Don't remove alias sets with exactly one
  8793. entry.
  8794. (register_alias_set): Re-implement to support memory tags instead
  8795. of INDIRECT_REF nodes. Document algorithm.
  8796. (find_alias_for): Likewise.
  8797. (may_alias_p): Likewise.
  8798. (add_may_alias): Likewise.
  8799. (find_vars_r): If a pointer assignment is found and the RHS of the
  8800. assignment may access global memory, mark the pointer as pointing
  8801. to global memory.
  8802. Handle INDIRECT_REF nodes by marking the base pointer as
  8803. dereferenced.
  8804. Do not share INDIRECT_REF nodes.
  8805. (add_referenced_var): Don't handle INDIRECT_REF nodes.
  8806. If called from a store operation, mark the variable as stored.
  8807. By default mark the variable as not having real references.
  8808. When processing a pointer that has been dereferenced, create a
  8809. memory tag for the pointer.
  8810. (add_indirect_ref_var): Remove. Update all callers.
  8811. (get_virtual_var): Don't handle INDIRECT_REF nodes.
  8812. (find_hidden_use_vars_r):
  8813. * tree-flow-inline.h (get_var_ann): New function. Change all
  8814. functions that called var_ann and create_var_ann to call
  8815. get_var_ann.
  8816. (get_stmt_ann): Likewise.
  8817. (set_indirect_ref): Remove. Update all callers.
  8818. (indirect_ref): Remove. Update all callers.
  8819. (create_indirect_ref): Remove. Update all callers.
  8820. * tree-flow.h (struct var_ann_d): Remove fields 'is_loaded',
  8821. 'unused' and 'indirect_ref'.
  8822. Add fields 'mem_tag', 'is_mem_tag', 'is_alias_tag' and
  8823. 'has_real_refs'.
  8824. (get_var_ann, get_stmt_ann): Declare.
  8825. (create_indirect_ref, set_indirect_ref, indirect_ref): Remove.
  8826. * tree-pretty-print.c (dump_generic_node): Don't handle
  8827. INDIRECT_REF nodes inside SSA_NAME nodes.
  8828. * tree-simple.c (get_base_symbol): Don't handle INDIRECT_REF nodes.
  8829. (is_simple_unary_expr): Don't call STRIP_NOPS.
  8830. * tree-ssa-copyprop.c (get_original): Don't handle INDIRECT_REF
  8831. nodes. Allow pointers to be copy propagated.
  8832. * tree-ssa-dce.c (need_to_preserve_store): Don't handle
  8833. INDIRECT_REF nodes.
  8834. * tree-ssa-live.c (create_ssa_var_map): Only process variables that
  8835. have real references.
  8836. * tree-ssa.c: Update documentation regarding INDIRECT_REF nodes.
  8837. (update_indirect_ref_vuses): Remove. Update all users.
  8838. (update_pointer_vuses): Remove. Update all users.
  8839. (MAY_COPYPROP_P): Remove. Update all users.
  8840. (create_temp): Don't handle INDIRECT_REF nodes.
  8841. (coalesce_ssa_name): Ignore variables that have no real references.
  8842. (rewrite_stmt): Mark the statement modified if a new copy or
  8843. constant was propagated into it.
  8844. Don't special-case pointers.
  8845. (rewrite_operand): Don't handle INDIRECT_REF nodes.
  8846. * tree.h (SSA_VAR_P): Remove. Update all users.
  8847. (SSA_DECL_P): Rename to SSA_VAR_P.
  8848. 2003-05-22 Jeff Law <law@redhat.com>
  8849. * gimplify.c (simplify_expr): Avoid gimplifying expressions which
  8850. are already in gimple form.
  8851. * tree-simple.c (is_simple_constructor): No longer treat TREE_STATIC
  8852. constructors specially.
  8853. (is_simple_addr_expr_arg): If we're taking the address of a label
  8854. for the first time, then the ADDR_EXPR is not in gimple form.
  8855. 2003-05-22 Jason Merrill <jason@redhat.com>
  8856. * tree-cfg.c (compute_reachable_eh): Don't skip cleanups.
  8857. * tree-dfa.c (add_referenced_var): Read-only INDIRECT_REFs can
  8858. also be clobbered by function calls.
  8859. 2003-05-22 Jeff Law <law@redhat.com>
  8860. * expr.c (convert_move): Avoid making silly copies.
  8861. (expand_expr, case BIND_EXPR): Correctly determine when the
  8862. result of the BIND_EXPR will not be used.
  8863. 2003-05-21 Jason Merrill <jason@redhat.com>
  8864. * tree-cfg.c (compute_reachable_eh): Handle multiple CATCH_EXPRs.
  8865. * builtins.c (simplify_builtin_next_arg): Split out from...
  8866. (expand_builtin_next_arg): ...here.
  8867. (simplify_builtin_va_start): Split out from...
  8868. (expand_builtin_va_start): ...here.
  8869. (simplify_builtin): Call it.
  8870. * gimplify.c (simplify_call_expr): If simplify_builtin worked,
  8871. just return.
  8872. 2003-05-20 Jason Merrill <jason@redhat.com>
  8873. * gimplify.c (shortcut_cond_expr, shortcut_cond_r): Rewrite.
  8874. (simplify_cond_expr): Also invert ifs with no 'then'.
  8875. (build_and_jump): New fn, split out from...
  8876. (gimplify_exit_expr): ...here. Don't bother gimplifying the
  8877. condition.
  8878. * gimplify.c (simplify_save_expr): Add post-effects to the
  8879. postqueue.
  8880. * gimplify.c (mostly_copy_tree_r): Don't unshare constants.
  8881. 2003-05-20 Jeff Law <law@redhat.com>
  8882. * expr.c (expand_expr, case COND_EXPR): Avoid useless RTL generation
  8883. when the THEN or ELSE arm is empty.
  8884. * tree-cfg.c (make_loop_expr_blocks): Do not accept next_block_link
  8885. as an argument, make it a local variable. Callers changed.
  8886. * tree-cfg.c (remove_useless_stmts_and_empty_vars): Eliminate
  8887. GOTO_EXPRs which jump to the next statement occuring in an
  8888. outer control/block structure nest.
  8889. 2003-05-20 Diego Novillo <dnovillo@redhat.com>
  8890. * tree-ssa-ccp.c (set_rhs): Fix typo in handling of
  8891. RETURN_EXPR nodes.
  8892. 2003-05-19 Daniel Berlin <dberlin@dberlin.org>
  8893. * tree-alias-common.c (alias_get_name): Handle unnamed variables once
  8894. and for all.
  8895. 2003-05-19 Jeff Law <law@redhat.com>
  8896. * tree-ssa-dce.c (remove_conditional): If the conditional's block
  8897. has no post dominator in the CFG, then wire it to the exit node.
  8898. Avoid unnecessary check of bb->succ.
  8899. 2003-05-17 Daniel Berlin <dberlin@dberlin.org>
  8900. * tree-pretty-print.c (MASK_POINTER): Parameter is P, not node.
  8901. 2003-05-17 Daniel Berlin <dberlin@dberlin.org>
  8902. * tree-alias-common.c (get_alias_var): Handle REFERENCE_EXPR.
  8903. (find_func_aliases): Ditto.
  8904. (get_alias_var): Use POINTER_TYPE_P.
  8905. 2003-05-16 Frank Ch. Eigler <fche@redhat.com>
  8906. * gcc.c (cc1_options): Correct "-fmudflapth" handling.
  8907. * tree-mudflap.c (mudflap_c_function, mf_build_check_statement_for):
  8908. Use locally cached mask/shift values only in single-threaded mode.
  8909. 2003-05-16 Daniel Berlin <dberlin@dberlin.org>
  8910. * tree-alias-common.c (ptr_may_alias_var): Fix DECL_CONTEXT
  8911. checking.
  8912. 2003-05-16 Andrew MacLeod <amacleod@redhat.com>
  8913. * tree-flow.h (ssa_make_edge): Remove prototype.
  8914. * tree-ssa-dce.c (remove_dead_stmt): Change comment about removing
  8915. conditionals.
  8916. (remove_conditional): Don't update PHI nodes or call ssa_make_edge.
  8917. * tree-ssa.c (ssa_make_edge): Remove.
  8918. 2003-05-16 Jeff Law <law@redhat.com>
  8919. * tree-cfg.c (remove_useless_stmts_and_vars): Handle case where
  8920. both arms of an if-then-else simply jump to the same location.
  8921. * tree-ssa-ccp.c (get_rhs): Correctly handle MODIFY_EXPR embedded in
  8922. a RETURN_EXPR.
  8923. (set_rhs): Likewise.
  8924. 2003-05-15 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
  8925. * Makefile.in (regmove.o-warn): Change to -Wno-error.
  8926. 2003-05-15 Andrew MacLeod <amacleod@redhat.com>
  8927. * tree-cfg.c (enum find_location_action): Enum for find_insert_location.
  8928. (bsi_insert_before): Handle insert at start of a BB and update pointers
  8929. from parents if appropriate.
  8930. (find_insert_location): Handle COND_EXPR properly. Return
  8931. an enum type indicating what action to take on the returned value.
  8932. (bsi_commit_first_edge_insert): Use new returned action.
  8933. 2003-05-15 Jeff Law <law@redhat.com>
  8934. * tree-cfg.c (make_edges): Factor out loop invariants from
  8935. code to insert edges from the TRY to the FINALLY block.
  8936. Avoid creating unnecessary edges from the end of the
  8937. FINALLY block back to the start of the FINALLY block.
  8938. 2003-05-15 Diego Novillo <dnovillo@redhat.com>
  8939. * tree-ssa.c (rewrite_out_of_ssa): Undo previous patch.
  8940. 2003-05-15 Diego Novillo <dnovillo@redhat.com>
  8941. * tree-ssa.c (rewrite_out_of_ssa): Don't dump the optimized
  8942. function after the SSA->normal pass.
  8943. 2003-05-14 Toon Moene <toon@moene.indiv.nluug.nl>
  8944. * Makefile.in: Add additional -Wno-error targets for Alpha.
  8945. 2003-05-13 Jason Merrill <jason@redhat.com>
  8946. * gdbinit.in (pgs, pge): New macros.
  8947. Implement expression temporary optimization.
  8948. * gimplify.c (gimplify_ctx): Add temp_htab field.
  8949. (push_gimplify_context): Initialize it.
  8950. (pop_gimplify_context): Destroy it.
  8951. (simplify_expr): If there's no internal postqueue, generate an
  8952. expression temporary.
  8953. (gimple_tree_hash, gimple_tree_eq): New fns.
  8954. (create_tmp_from_val, lookup_tmp_var): New fns.
  8955. (get_formal_tmp_var): New fn.
  8956. (internal_get_tmp_var): New fn.
  8957. (get_initialized_tmp_var): Use it.
  8958. * tree-simple.h: Declare it.
  8959. * gimplify.c (simplify_cond_expr): Reorganize.
  8960. (shortcut_cond_expr, shortcut_cond_r): New fns.
  8961. (build_and_jump): New fn.
  8962. (gimplify_exit_expr): Use it.
  8963. * gimplify.c (simplify_expr): Do better at stripping unnecessary
  8964. NOPs. Tidy GOTO_EXPR handling. Don't allow NON_LVALUE_EXPR.
  8965. * tree-simple.c (is_simple_modify_expr): Don't allow NON_LVALUE_EXPR.
  8966. (is_simple_binary_expr, is_simple_condexpr): Likewise.
  8967. (is_simple_unary_expr, is_simple_compound_lval): Likewise.
  8968. (is_simple_id): Likewise.
  8969. * tree-ssa.c (rewrite_stmt): Discard redundant assignments.
  8970. (avail_expr_eq): Don't test ops1 == ops2.
  8971. (avail_expr_hash): Use iterative_hash_object.
  8972. 2003-05-13 Jeff Law <law@redhat.com>
  8973. * tree-cfg.c (cleanup_tree_cfg): Update comments. Set repeat
  8974. anytime we remove a control structure.
  8975. * tree-flow.h (struct var_ann_d): New field occurs_in_abnormal_phi.
  8976. * tree-ssa.c (MAY_COPYPROP_P): Do not allow copy propagations
  8977. if either argument occurs in an abnormal phi.
  8978. * tree-dfa.c (add_phi_arg): Set occurs_in_abrnomal_phi as needed.
  8979. * tree-ssa-copyprop.c (copyprop_stmt): Do not allow copy
  8980. propagations if either argument occurs in an abnormal phi.
  8981. (copyprop_phi): Likewise.
  8982. 2003-05-12 Diego Novillo <dnovillo@redhat.com>
  8983. * c-common.h (STATEMENT_CODE_P): Use size_t cast instead
  8984. of int.
  8985. (INIT_STATEMENT_CODES): Change type of local variable i to
  8986. size_t.
  8987. 2003-05-12 Diego Novillo <dnovillo@redhat.com>
  8988. * c-pretty-print.c (dump_c_node): Call CONSTRUCTOR_ELTS
  8989. to access the operand of a CONSTRUCTOR node.
  8990. * tree-pretty-print.c (dump_generic_node): Likewise.
  8991. 2003-05-11 Diego Novillo <dnovillo@redhat.com>
  8992. * c-simplify.c (simplify_if_stmt): Replace calls to
  8993. warning_with_file_and_line with warning.
  8994. 2003-05-12 Frank Ch. Eigler <fche@redhat.com>
  8995. * toplev.c (lang_independent_options): Add "-fmudflapth".
  8996. * flags.h (flag_mudflap): Document meaning of >1 value.
  8997. * gcc.c (MFWRAP_SPEC, MFLIB_SPEC): Add -fmudflapth support.
  8998. (cpp_unique_options, cc1_options): Ditto.
  8999. 2003-05-10 Sebastian Pop <s.pop@laposte.net>
  9000. * gimplify.c (simplify_expr): Replace CONST_DECL with its DECL_INITIAL.
  9001. 2003-05-09 Sebastian Pop <s.pop@laposte.net>
  9002. * tree-optimize.c (optimize_function_tree): Clarify the use of the
  9003. loop analyzer.
  9004. 2003-05-09 Jeff Law <law@redhat.com>
  9005. * c-simplify.c (simplify_cleanup): Remove code which optimizes
  9006. TRY_FINALLY and TRY_CATCH. It doesn't trigger.
  9007. * tree-cfg.c (remove_useless_stmts_and_vars): Optimize away
  9008. TRY_CATCH and TRY_FINALLY blocks when possible.
  9009. 2003-05-09 Diego Novillo <dnovillo@redhat.com>
  9010. * tree-pretty-print.c (dump_generic_node): CONSTRUCTOR
  9011. nodes have only one operand now.
  9012. 2003-05-08 Andrew MacLeod <amacleod@redhat.com>
  9013. * tree-cfg.c (pdom_info): New file level static.
  9014. (cleanup_tree_cfg): Free dominance info, if it was used.
  9015. (bsi_replace): New. Replace a stmt with a new one.
  9016. (linearize_cond_expr): Use post dominator info to determine is a
  9017. conditional can be safely removed.
  9018. (find_insert_location): New. Determine where to insert a new stmt that
  9019. is placed on a split edge.
  9020. (bsi_commit_first_edge_insert): Use find_insert_location to determine
  9021. where to link a stmt when splitting an edge.
  9022. (merge_tree_blocks): When deleting a basic block, remove it from the
  9023. dominance structure if it exists.
  9024. * tree-dfa.c (add_stmt_operand): Don't rename local statics. Treat
  9025. them just like globals.
  9026. * tree-flow.h (struct var_ann_d): Add root_var_processed bit and
  9027. root_index fields.
  9028. * tree-ssa-dce.c (process_worklist): Mark conditions feeding PHI's as
  9029. necessary as well.
  9030. (remove_dead_phis): Add missing debug information.
  9031. * tree-ssa-live.c (var_union): Handle combining partitions when one
  9032. has a root_variable as a representative.
  9033. (compact_var_map): Add comments and use flags.
  9034. (init_root_var): Use new root_var fields in struct var_ann_d.
  9035. (dump_root_var): Send output to specified file, not stderr.
  9036. (dump_var_map): Remove dump_flag parameter & some grotesque debug info.
  9037. * tree-ssa-live.h (VAR_ANN_ROOT_INDEX): Define.
  9038. (VARMAP_NORMAL, VARMAP_NO_SINGLE_DEFS): Define flags for compact_var_map.
  9039. (var_to_partition_to_var): Return NULL if not in a partition.
  9040. (find_root_var): Use VAR_ANN_ROOT_INDEX.
  9041. * tree-ssa.c (insert_copy_on_edge): Add listing info.
  9042. (coalesce_ssa_name): Coalesce live-on-entry variables to their root.
  9043. Coalesce partitions across abnormal edges.
  9044. (assign_vars): Remove redundant initialization code. Handle root_vars
  9045. which have already been coalesced to a partition.
  9046. (rewrite_out_of_ssa): Add debug info & remove PHI nodes when processed.
  9047. (rewrite_stmt): Don't redefine redundant expressions.
  9048. 2003-05-08 Jeff Law <law@redhat.com>
  9049. * c-simplify.c (simplify_expr_stmt): Make sure to
  9050. simplify the body of the EXPR_STMT.
  9051. * tree-dfa.c (remove_decl): Accept new argument for the block
  9052. to start the search.
  9053. * tree-flow.h (remove_decl): Update prototype.
  9054. * tree-cfg.c (remove_stmt): Pass the toplevel block to
  9055. remove_decl.
  9056. * tree-dfa.c (find_hidden_use_vars): No longer returns a value.
  9057. Callers and prototype updated. No longer need to look for
  9058. nested functions, instead just mark any variables and
  9059. parameters with DECL_NONLOCAL set as having hidden uses.
  9060. 2003-05-08 Diego Novillo <dnovillo@redhat.com>
  9061. * version.c (version_string): Change format to show daily
  9062. datestamp and merged date.
  9063. 2003-05-07 Jeff Law <law@redhat.com>
  9064. * tree-cfg.c (remove_useless_stmts_and_vars): Do not remove
  9065. the toplevel BIND_EXPR for an inlined function.
  9066. * tree-dfa.c (find_hidden_use_vars): Look at the size of
  9067. VAR_DECLs, not the size of ARRAY_TYPES. Also make sure
  9068. to reset *inside_vla to its original value when done
  9069. processing any particular VAR_DECL.
  9070. 2003-05-06 Diego Novillo <dnovillo@redhat.com>
  9071. * c-simplify.c (simplify_if_stmt): Warn if
  9072. -Wunreachable-code is given and the conditional is always
  9073. true or always false.
  9074. * expr.c (expand_expr): Don't try to expand FUNCTION_DECL
  9075. nodes when processing BIND_EXPR_VARS.
  9076. * varasm.c (output_constant_def_contents): Re-use the
  9077. label when emitting a label for mudflap.
  9078. Disable the following patch:
  9079. 2003-04-30 Steven Bosscher <steven@gcc.gnu.org>
  9080. * ggc-page.c (TREE_EXP_SIZE): Define.
  9081. (extra_order_size_table): New entry for expr trees with
  9082. two operands.
  9083. 2003-05-06 Jeff Law <law@redhat.com>
  9084. * tree-cfg.c (make_exit_edges): Fix handling of blocks which
  9085. end with calls.
  9086. * tree-cfg.c (remove_useless_stmts_and_vars): Remove GOTO_EXPRs
  9087. to the immediately following tree node.
  9088. * tree-cfg.c (make_goto_expr_edges): Fix typo in comment.
  9089. (remove_useless_stmts_and_vars): New function.
  9090. * tree-flow.h (remove_useless_stmts_and_vars): Prototype.
  9091. * tree-ssa.c (rewrite_out_of_ssa): After returning to normal
  9092. form, call remove_useless_stmts_and_vars.
  9093. 2003-05-02 Daniel Berlin <dberlin@dberlin.org>
  9094. * tree-alias-common.c (alias_get_name): Given unnamed result decls
  9095. a name.
  9096. (create_fun_alias_var): Use DECL_RESULT if available.
  9097. 2003-05-02 Jeff Law <law@redhat.com>
  9098. * tree-inline.c (expand_call_inline): Avoid creating naked
  9099. _DECL nodes for inlined functions which had NRV optimizations
  9100. applied.
  9101. 2003-05-02 Diego Novillo <dnovillo@redhat.com>
  9102. * tree-cfg.c (build_tree_cfg): Update comment.
  9103. (make_blocks): Don't skip over empty statements.
  9104. Move exception handling code ...
  9105. (compute_reachable_eh): ... here.
  9106. (set_parent_stmt): Don't skip over empty statements.
  9107. (bsi_remove): Don't return early on empty statements.
  9108. Don't call STRIP_NOPS.
  9109. (remove_stmt): Don't call STRIP_NOPS.
  9110. Always compute the block holding the statement.
  9111. After replacing the statement with an empty statement, add the
  9112. empty statement to the block.
  9113. (successor_block): Don't call STRIP_NOPS.
  9114. (first_exec_stmt): Likewise.
  9115. (first_exec_block): Don't return early for empty statements.
  9116. (first_stmt): Don't test for NULL blocks.
  9117. Reformat to improve legibility.
  9118. (bsi_next_in_bb): Don't call STRIP_NOPS.
  9119. Reformat to improve legibility.
  9120. (set_bb_for_stmt): Don't ignore empty statements.
  9121. * tree-dfa.c (get_stmt_operands): Don't call STRIP_NOPS.
  9122. (create_stmt_ann): Don't abort on emtpy statements.
  9123. Don't call STRIP_NOPS.
  9124. (copy_stmt): Remove unused function.
  9125. * tree-flow.h (copy_stmt): Remove prototype.
  9126. * tree-flow-inline.h: Don't call STRIP_NOPS.
  9127. Remove local variable 't'.
  9128. (bsi_stmt): Don't return NULL_TREE for empty statements.
  9129. Ignore error_mark_node.
  9130. * tree-iterator.h (tsi_next): Don't call STRIP_NOPS.
  9131. (tsi_stmt_ptr): Likewise.
  9132. (tsi_stmt): Likewise.
  9133. Don't return NULL_TREE for empty statements.
  9134. * tree-pretty-print.c (dump_generic_node): Don't ignore empty
  9135. statements.
  9136. * tree-ssa-ccp.c (fold_stmt): Don't call STRIP_NOPS.
  9137. * tree-ssa-dce.c (find_useful_stmts): Likewise.
  9138. (remove_dead_stmt): Likewise.
  9139. * tree-ssa.c (mark_def_sites): Likewise.
  9140. (rewrite_out_of_ssa): Likewise.
  9141. (rewrite_stmt): Likewise.
  9142. * tree.c (make_ssa_name): Don't ignore empty statements.
  9143. (body_is_empty): Fix comment.
  9144. 2003-05-01 Jeff Law <law@redhat.com>
  9145. * tree-dfa.c (find_hidden_use_vars): Renamed from find_vla_decls.
  9146. Now returns a value indicating if nested function was found.
  9147. When nested functions are found, mark suitable variables as
  9148. having hidden uses.
  9149. (find_hidden_use_vars_r): Renamed from find_vla_decls_r.
  9150. (compute_may_alias): Corresponding changes. Handle
  9151. multiple BLOCKs at the toplevel of a function.
  9152. 2003-04-30 Diego Novillo <dnovillo@redhat.com>
  9153. * tree.c (build_empty_stmt): New function.
  9154. * tree.h (IS_EMPTY_STMT): Define.
  9155. (TI_EMPTY_STMT): Remove.
  9156. (empty_stmt_node): Remove.
  9157. Replace 'X = empty_stmt_node' with 'X = build_empty_stmt ()',
  9158. and 'X == empty_stmt_node' with 'IS_EMPTY_STMT (X)' everywhere.
  9159. (build_empty_stmt): Declare.
  9160. * cp/cp-simplify.c (cp_simplify_stmt): Use IS_EMPTY_STMT.
  9161. * java/java-tree.h (build_java_empty_stmt): Declare.
  9162. * java/expr.c (build_java_empty_stmt): New function.
  9163. * java/decl.c (java_init_decl_processing): Don't build empty_stmt_node.
  9164. Replace 'X = empty_stmt_node' with 'X = build_java_empty_stmt ()',
  9165. and 'X == empty_stmt_node' with 'IS_EMPTY_STMT (X)' everwhere.
  9166. 2003-04-30 Jeff Law <law@redhat.com>
  9167. * tree-dfa.c (get_expr_operands): Do not ignore operands of an
  9168. an ADDR_EXPR if it is a PARM_DECL or VAR_DECL.
  9169. * tree-dfa.c (get_expr_operands): Look inside operands in
  9170. a TREE_LIST.
  9171. 2003-04-29 Diego Novillo <dnovillo@redhat.com>
  9172. * builtins.def (BUILTIN_CONSTANT_P): Mark as constant.
  9173. * tree-dfa.c (get_expr_operands): Do not add VDEF operands for
  9174. dereferenced pointers at call sites.
  9175. * tree-ssa.c (assign_vars): Abort if we couldn't coalesce all the
  9176. versions together.
  9177. 2003-04-29 Andrew MacLeod <amacleod@redhat.com>
  9178. * tree-cfg.c (bsi_start): If there are no stmts in a block, use the
  9179. context pointer to represent the basic block.
  9180. (bsi_insert_after): Handle inserting into empty blocks better.
  9181. (bsi_insert_before): Call bsi_insert_after to handle empty blocks.
  9182. * tree-ssa.c (elim_create): Clear bitmap after its been processed
  9183. instead of during loop.
  9184. 2003-04-27 Diego Novillo <dnovillo@redhat.com>
  9185. * Makefile.in (tree-mudflap.o): Add dependency on $(TREE_DUMP_H).
  9186. * c-decl.c (c_expand_body_1): Don't call simplify_function_tree
  9187. after mudflap_c_function.
  9188. Move mudflap instrumentation after SSA optimizers.
  9189. * tree-dump.c (dump_files): Add entry for -fdump-tree-mudflap.
  9190. * tree.h (enum tree_dump_index): Add TDI_mudflap.
  9191. * doc/invoke.texi: Document -fdump-tree-mudflap.
  9192. * tree-mudflap.c: Include tree-dump.h.
  9193. (dump_file): New local variable.
  9194. (dump_flags): New local variable.
  9195. (mudflap_c_function): Call dump_begin, dump_end and dump_function.
  9196. (mf_decl_cache_locals): Set DECL_CONTEXT for __mf_lookup_shift_l
  9197. and __mf_lookup_mask_l to current_function_decl.
  9198. (mf_offset_expr_of_array_ref): Likewise for __mf_index_X.
  9199. (mf_build_check_statement_for): Re-implement to emit a proper
  9200. STMT_EXPR.
  9201. (mx_xfn_indirect_ref): Emit detailed debugging info if
  9202. -fdump-tree-mudflap-details is given.
  9203. (mudflap_enqueue_decl): Likewise
  9204. * tree-optimize.c (optimize_function_tree): Don't check for
  9205. -fmudflap.
  9206. 2003-04-26 Diego Novillo <dnovillo@redhat.com>
  9207. * c-simplify.c (build_bc_goto): If the target label couldn't be
  9208. found, emit an error message.
  9209. 2003-04-25 Andrew MacLeod <amacleod@redhat.com>
  9210. * tree-ssa-live.c (compact_var_map): Add parameter to exclude variables
  9211. with a single SSA version.
  9212. (init_root_var): Allow that a var_map might not be compacted yet.
  9213. * tree-ssa-live.h (compact_var_map): Change Prototype.
  9214. * tree-ssa.c (rewrite_out_of_ssa): When coalescing, don't include single
  9215. reference variables during the compaction.
  9216. 2003-04-25 Jeff Law <law@redhat.com>
  9217. * tree-optimize.c (optimize_function_tree): Simplify slightly.
  9218. 2003-04-25 Andrew MacLeod <amacleod@redhat.com>
  9219. * tree-ssa.c (struct _elim_graph): Change type of fields
  9220. 'pred' and 'succ' to be bitmaps instead of sbitmaps.
  9221. Update all uses.
  9222. 2003-04-25 Diego Novillo <dnovillo@redhat.com>
  9223. * tree-cfg.c (linearize_cond_expr): Reformat.
  9224. * tree-dfa.c (get_expr_operands): Check for read-only
  9225. status the dereferenced argument pointer, not the pointer
  9226. itself.
  9227. (add_stmt_operand): Always consider global variables as
  9228. virtual operands.
  9229. 2003-04-24 Jason Merrill <jason@redhat.com>
  9230. * gimplify.c (simplify_cond_expr): Avoid redundant gimplification.
  9231. Add TREE_VEC of case labels to the SWITCH_EXPR during gimplification.
  9232. * tree.def (CASE_LABEL_EXPR): Add an operand for the LABEL_DECL.
  9233. * tree.h (SWITCH_LABELS, CASE_LABEL): New macros.
  9234. * c-simplify.c (c_simplify_stmt) <CASE_LABEL>: Create LABEL_DECL here.
  9235. * expr.c (expand_expr) <CASE_LABEL_EXPR>: Not here.
  9236. * gimplify.c (gimplify_ctx): Add case_labels field.
  9237. (gimplify_switch_expr, gimple_add_case_label): New fns.
  9238. (simplify_expr): Use them.
  9239. 2003-04-24 Andrew MacLeod <amacleod@redhat.com>
  9240. * tree-flow.h (processed_out_of_ssa): Rename to out_of_ssa_tag.
  9241. * tree-ssa-live.c (register_ssa_partition): Add variable to partition.
  9242. (change_partition_var): Use out_of_ssa_tag.
  9243. (create_ssa_var_map): Add all uses, defs and PHI elements to partition.
  9244. (new_tree_live_info): Create a live range info structure.
  9245. (delete_tree_live_info): Free storage.
  9246. (live_worklist): Fill in the live range info for a variable for the
  9247. blocks between the def and all the blocks containing uses.
  9248. (set_if_valid): Set partition bit if variable is in a partition.
  9249. (add_livein_if_notdef): Set live on entry bit for a var's partition
  9250. if a definition has not been seen.
  9251. (calculate_live_on_entry): Create partition live on entry bitmaps for
  9252. all basic blocks .
  9253. (calculate_live_on_exit): Calculate live on exit information for each
  9254. basic block.
  9255. (init_root_var): Initialize and fill in a root_var structure.
  9256. (remove_root_var_partition): remove a partition from a root_var list.
  9257. (delete_root_var): Free storage.
  9258. (dump_root_var): Display root_var summary.
  9259. (dump_var_map): Show extra info for ssa name versions.
  9260. * tree-ssa-live.h (NO_PARTITION): Define.
  9261. (register_ssa_partition): Remove.
  9262. (partition_to_var): Use partition_find after decompressing.
  9263. (var_to_partition): Return NO_PARTITION if var is not in a partition.
  9264. (struct tree_live_info_d): Define live range info structure.
  9265. (partition_is_global): Return 1 if used outside a basic block.
  9266. (live_entry_blocks): Return bitmap over blocks that partition is live
  9267. on entry to.
  9268. (live_on_exit): Return bitmap of partitions live on exit from a block.
  9269. (struct root_var_d): Define a root_var structure.
  9270. (ROOT_VAR_NONE): Define.
  9271. (num_root_vars): Number of variables in root_var object.
  9272. (root_var): Return variable for a root_var index.
  9273. (first_root_var_partition): Return first partition for a root_var.
  9274. (next_root_var_partition): Get next partition for a root_var.
  9275. (find_root_var): Find root_var index for a specific partition.
  9276. * tree-ssa.c (eliminate_extraneous_phis): Remove.
  9277. (set_if_valid): Set partition bit if variable is in a partition.
  9278. (add_conflicts_if_valid): Add conflict between variable and all
  9279. related partitions set in a bitvector.
  9280. (coalesce_ssa_name): Create a conflict graph and coalesce all
  9281. partitions which don't conflict and are related by the same root_var.
  9282. (assign_vars): Use a root_var object, and assign different real
  9283. variables to all partitions.
  9284. (rewrite_out_of_ssa): Call compact_var_map() once, and don't call
  9285. eliminate_extraneous_phis.
  9286. 2003-04-23 Daniel Berlin <dberlin@dberlin.org>
  9287. * tree-flow.h (create_global_var): Add prototype.
  9288. * tree-dfa.c (create_global_var): Externalize.
  9289. * tree-alias-common.c: Set DECL_CONTEXT on our temp alias vars.
  9290. (call_may_clobber): Make a copy of this function, since our version
  9291. will be slightly different soon.
  9292. (create_alias_vars): We need global_var, so create it if necessary.
  9293. 2003-04-23 Daniel Berlin <dberlin@dberlin.org>
  9294. * tree-ssa-pre.c (do_proper_save): Remove old code, since the new
  9295. insertion code works okay.
  9296. (pre_expression): Use new_rename_1, it removes a *lot* of useless
  9297. saves.
  9298. 2003-04-23 Jeff Law <law@redhat.com>
  9299. * gimplify.c (simplify_target_expr): Make sure to simplify
  9300. the cleanup too.
  9301. * tree-ssa.c (struct def_blocks_d): Add new field phi_insertion_points.
  9302. (compute_global_livein): Accept varray rather than bitmaps. Callers
  9303. updated. Rewrite to compute global life information for all the
  9304. objects in the varray in parallel.
  9305. (insert_phis_for_deferred_variables): New function.
  9306. (insert_phi_nodes_for): New argument DEF_MAPs. When an object
  9307. crosses the threshold for using fully pruned PHI insertions,
  9308. push it on the def_maps varray for deferred processing.
  9309. (insert_phi_nodes): Initialize def_maps. Pass it to
  9310. insert_phi_nodes_for. Drain the def_maps varray as it grows.
  9311. Also drain any residual objects in def_maps. Zero def_maps
  9312. when complete.
  9313. 2003-04-21 Jeff Law <law@redhat.com>
  9314. * tree-cfg.c (find_contained_blocks_and_edge_targets): New function.
  9315. (try_finallys): New varray used during edge creation.
  9316. (make_edges): Initialize try_finallys varray. After creating
  9317. all the "normal" edges, go back and create the special edges
  9318. for the try-finally blocks.
  9319. (make_ctrl_stmt_edges): Create edges for the EH nodes. Also
  9320. make sure to build the try-finally stack.
  9321. (make_exit_edges): Create edges from calls which may throw
  9322. to any directly reachable exception handlers.
  9323. (is_ctrl_altering_stmt): Statements which may throw alter
  9324. flow control.
  9325. * tree-cfg.c: Include except.h.
  9326. (eh_stack): New file-scoped varray.
  9327. (build_tree_cfg): Initialize eh_stack.
  9328. (make_catch_expr_blocks): New function.
  9329. (make_try_expr_blocks, make_eh_filter_expr_blocks): Likewise.
  9330. (make_blocks): Call new functions as needed. When ending a block
  9331. due to a statement that may throw, compute the reachable exception
  9332. handlers and store it in the statement's annotation.
  9333. (is_ctrl_stmt): Handle EH nodes.
  9334. (stmt_ends_bb_p): Likewise.
  9335. * tree-flow.h (stmt_ann_d): Add new field reachable_exception_handlers.
  9336. * except.c (check_handled): No longer static.
  9337. * except.h (check_handled): Prototype.
  9338. * c-simplify.c (c_build_bind_expr): Revert change from earlier today.
  9339. * c-common.h (find_reachable_label): Prototype.
  9340. * c-semantics.c (find_reachable_label): No longer static.
  9341. * c-simplify.c (c_build_bind_expr): Avoid creating unnecessary
  9342. BIND_EXPRs.
  9343. (simplify_cleanup): Avoid creating unnecessary TRY_CATCH_EXPRs
  9344. or TRY_FINALLY_EXPRs.
  9345. (simplify_if_stmt): If the condition is constant and the
  9346. unexecuted arm has no reachable code, then just emit
  9347. the executed arm.
  9348. 2003-04-18 Sebastian Pop <s.pop@laposte.net>
  9349. * cfghooks.h, cfghooks.c: New files.
  9350. * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h.
  9351. (OBJS): Add cfghooks.o.
  9352. (tree-optimize.o): Depends on cfgloop.h.
  9353. (cfghooks.o): New rule.
  9354. * basic-block.h (split_edge): Rename to rtl_split_edge.
  9355. (tree_split_edge): Declare.
  9356. (create_bb): Declare extern here.
  9357. (verify_flow_info): Rename to rtl_verify_flow_info.
  9358. (tree_verify_flow_info): Declare.
  9359. (cfghooks.h): Included here.
  9360. * cfgloop.c (tree.h, tree-flow.h): Included.
  9361. (make_forwarder_block): Renamed to rtl_make_forwarder_block.
  9362. (tree_make_forwarder_block): New static function.
  9363. (blocks_headers): Declared static.
  9364. (HEADER_BLOCK): Use blocks_headers instead of bb's .aux field.
  9365. (redirect_edge_with_latch_update, make_forwarder_block,
  9366. canonicalize_loop_headers): Don't allocate .aux, but makes grow
  9367. the blocks_headers array.
  9368. (canonicalize_loop_headers): Register tree_make_forwarder_block
  9369. into the tree_cfg_hooks and rtl_make_forwarder_block into the
  9370. rtl_cfg_hooks structure.
  9371. (canonicalize_loop_headers): Initialize/free the blocks_headers
  9372. array rather than the bb's .aux field.
  9373. * cfgloopmanip.c (loop_split_edge_with_NULL): New static function.
  9374. (remove_path, force_single_succ_latches):
  9375. Call loop_split_edge_with_NULL instead of loop_split_edge_with.
  9376. * cfgrtl.c (split_block): Update the comment.
  9377. (split_edge): Renamed rtl_split_edge.
  9378. (verify_flow_info): Renamed rtl_verify_flow_info.
  9379. * loop-init.c (loop_optimizer_init, loop_optimizer_finalize):
  9380. Execute code following the value of cfg_level.
  9381. * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks.
  9382. * tree-cfg.c (create_bb): Declared extern.
  9383. (build_tree_cfg): Call tree_register_cfg_hooks.
  9384. (make_edges, make_exit_edges): Remove the use of EDGE_FALLTHRU.
  9385. (bsi_commit_first_edge_insert): Use split_edge.
  9386. (tree_split_edge, tree_verify_flow_info): New functions.
  9387. * tree-optimize.c (cfgloop.h): Included.
  9388. (optimize_function_tree): Add #if 0'ed calls to
  9389. loop_optimizer_init and loop_optimizer_finalize.
  9390. 2003-04-16 Jeff Law <law@redhat.com>
  9391. * Makefile.in (tree-ssa.o): Depend on langhooks.h.
  9392. (tree-dfa.o, tree-cfg.o): Likewise.
  9393. * tree-cfg.c: Include langhooks.h
  9394. (dump_tree_cfg): Revamp how we get the current function's name
  9395. to not rely on current_function_name (and implicitly cfun).
  9396. (dump_cfg_stats, tree_cfg2dot): Likewise.
  9397. * tree-dfa.c: Include langhooks.h
  9398. (dump_immediate_uses): Revamp how we get the current function's name
  9399. to not rely on current_function_name (and implicitly cfun).
  9400. (dump_dfa_stats, dump_alias_info): Likewise.
  9401. * tree-ssa.c: Include langhooks.h
  9402. (dump_tree_ssa): Revamp how we get the current function's name
  9403. to not rely on current_function_name (and implicitly cfun).
  9404. * tree-cfg.c (make_loop_expr_blocks): When determining the value for
  9405. NEXT_BLOCK_LINK, correctly handle empty statement nodes at the
  9406. end of the tree.
  9407. (make_cond_expr_blocks, make_switch_expr_blocks): Likewise.
  9408. (make_bind_expr_blocks): Likewise.
  9409. * gimplify.c (keep_function_tree_in_gimple_form): Move check of
  9410. flag_disable_simple here. Include flags.h.
  9411. * Makefile.in (gimplify.o): Depends on flags.h
  9412. * c-decl.c (c_expand_body_1): No longer check flag_disable_simple.
  9413. * tree-inline.c (copy_body_r): Avoid creating non-gimple code
  9414. when inlining a function where the RESULT_DECL's initialization
  9415. is not on the RETURN_EXPR.
  9416. 2003-04-15 Jeff Law <law@redhat.com>
  9417. * tree-flow.h (struct var_ann_d): Renamed is_vla_decl field to
  9418. has_hidden_use.
  9419. (has_hidden_use, set_has_hidden_use): Renamed from is_vla_decl
  9420. and set_vla_decl.
  9421. * tree-flow-inline.h (has_hidden_use): Renamed from is_vla_decl.
  9422. Updated to use "has_hidden_use" instead of "is_vla_decl" field.
  9423. (set_has_hidden_use): Renamed from set_vla_decl.
  9424. Updated to use "has_hidden_use" instead of "is_vla_decl" field.
  9425. * tree-dfa.c (dump_variable): Corresponding changes.
  9426. (find_vla_decls_r): Likewise.
  9427. * c-simplify.c (simplify_decl_stmt): Likewise.
  9428. * tree-ssa-dce.c: Likewise.
  9429. 2003-04-09 Jeff Law <law@redhat.com>
  9430. * tree-dfa.c (struct alias_set_d, field tag_sym_set): Remove
  9431. unused field.
  9432. (register_alias_set): Rework to avoid incorrect coalescing of
  9433. entries. Fix memory leak. No longer set field tag_sym_set.
  9434. (get_expr_operands): ADDR_EXPR expressions may have interesting
  9435. operands in some cases.
  9436. 2003-04-09 Diego Novillo <dnovillo@redhat.com>
  9437. * gimplify.c (simplify_expr): Handle VECTOR_CST nodes.
  9438. * tree-cfg.c (make_blocks): Ignore empty statement containers.
  9439. Create a basic block before processing containers that only have
  9440. empty statements.
  9441. (make_loop_expr_blocks): Use the container instead of the statement
  9442. when setting NEXT_BLOCK_LINK.
  9443. (make_cond_expr_blocks): Likewise.
  9444. (make_switch_expr_blocks): Likewise.
  9445. (make_bind_expr_blocks): Likewise.
  9446. (successor_block): If the last statement of the block is the empty
  9447. statement, use its container to get NEXT_BLOCK_LINK.
  9448. (stmt_starts_bb_p): Return false if the statement is NULL.
  9449. * tree-pretty-print.c (dump_generic_node): Handle VECTOR_CST nodes.
  9450. * tree-simple.c (is_simple_const): Accept VECTOR_CST as constants.
  9451. * objc/objc-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P):
  9452. Define.
  9453. 2003-04-06 Diego Novillo <dnovillo@redhat.com>
  9454. * tree-cfg.c (remove_bb): Call ssa_remove_edge.
  9455. (cleanup_cond_expr_graph): Likewise.
  9456. (cleanup_switch_expr_graph): Likewise.
  9457. (disconnect_unreachable_case_labels): Likewise.
  9458. (merge_tree_blocks): Likewise.
  9459. Update PHI nodes at BB2's successor.
  9460. (dump_tree_bb): Show PHI nodes in the block.
  9461. * tree-dfa.c (add_phi_arg): Update comment.
  9462. (remove_phi_arg_num): New function.
  9463. (remove_phi_arg): Call it.
  9464. Move from tree-ssa.c.
  9465. (remove_phi_node): Move from tree-ssa.c.
  9466. * tree-flow.h (ssa_make_edge): Declare.
  9467. (ssa_remove_edge): Declare.
  9468. * tree-pretty-print.c (dump_generic_node): Show block where PHI
  9469. arguments are coming from.
  9470. * tree-ssa-dce.c (pdom_info): New local variable.
  9471. (remove_dead_stmts): Initialize it and free it at the end.
  9472. (remove_conditional): New function.
  9473. (remove_dead_stmt): Call it.
  9474. * tree-ssa.c (eliminate_phi): If the edge index is -1, abort
  9475. compilation.
  9476. (ssa_remove_edge): New function.
  9477. (ssa_make_edge): New function.
  9478. 2003-04-06 Andrew MacLeod <amacleod@redhat.com>
  9479. * tree-cfg.c (push_bsi): New. Push a block_stmt_iterator onto a stack.
  9480. (pop_bsi): New. Pop a block_stmt_iterator off a stack.
  9481. * tree-flow-inline.h (struct bsi_list_d): Block iterator stack struct.
  9482. (new_bsi_list): Start a new bsi stack.
  9483. (empty_bsi_stack): Is stack empty.
  9484. (FOR_EACH_BSI_IN_REVERSE): Macro for processing bsi's in reverse.
  9485. (FOR_EACH_STMT_IN_REVERSE): Macro for processing stmt's in reverse.
  9486. 2003-04-06 Andreas Jaeger <aj@suse.de>
  9487. * treelang/treetree.c (tree_code_create_function_initial): Replace
  9488. calls to non-existent function annotate_with_file_line_column with
  9489. calls to annotate_with_file_line.
  9490. (tree_code_create_variable): Likewise.
  9491. 2003-04-05 Diego Novillo <dnovillo@redhat.com>
  9492. * tree-dfa.c (get_expr_operands): Do not clobber readonly operands
  9493. in CALL_EXPRs.
  9494. (find_vars_r): Likewise.
  9495. (add_indirect_ref_var): When creating new INDIRECT_REF variables,
  9496. copy the readonly attribute from the variable's type.
  9497. 2003-04-05 Diego Novillo <dnovillo@redhat.com>
  9498. * tree.c (copy_node): Never copy tree annotations.
  9499. 2003-04-05 Diego Novillo <dnovillo@redhat.com>
  9500. * tree-ssa-ccp.c (visit_cond_stmt): Don't short circuit evaluation
  9501. of UNDEFINED conditional expressions.
  9502. 2003-04-04 Andrew MacLeod <amacleod@redhat.com>
  9503. * Makefile.in : Add tree-ssa-live.c and tree-ssa-live.h files.
  9504. * tree-ssa.c (struct _var_map, create_var_map, delete_var_map,
  9505. var_from_partition, get_var_partition, mapped_var_from_ref,
  9506. compact_var_map, dump_tree_partition, set_partition_for_var,
  9507. set_var_mapping, create_var_partition): Remove.
  9508. (create_temp): Allow temps to be created from SSA_NAME vars as well.
  9509. (eliminate_name, eliminate_build, elim_backward, elim_create,
  9510. eliminate_phi): Use new var map interface.
  9511. (coalesce_ssa_name): New. Coalesce ssa_name ranges together.
  9512. (assign_vars): Assign real variables to ssa_name partitions.
  9513. (rewrite_out_of_ssa): Use new varmap partition and routines.
  9514. * tree-ssa-live.h: New file
  9515. (var_map): Structure for variable map.
  9516. (num_var_partitions): Number of partitions.
  9517. (partition_to_var): Return variable for partition.
  9518. (var_to_partition): Return partition variable is in.
  9519. (var_to_partition_to_var): Return variable representing partition
  9520. another variable is in.
  9521. (register_ssa_partition): Initialize a partition element as used.
  9522. * tree-ssa-live.c: New file.
  9523. (init_var_map): Initialize a var_map.
  9524. (delete_var_map): Free storage for a var_map.
  9525. (var_union): Combine 2 partitions.
  9526. (compact_var_map): Reduce the number of partitions in a var_map.
  9527. (change_partition_var): Assign a specific var to a partition.
  9528. (create_ssa_var_map): Initialize a var_map with referenced variables.
  9529. (dump_var_map): Debug output for a var_map.
  9530. 2003-04-03 Diego Novillo <dnovillo@redhat.com>
  9531. * fold-const.c (fold_relational_hi_lo): Add missing comparison when
  9532. folding comparisons to signed_max+1.
  9533. 2003-04-02 Jason Merrill <jason@redhat.com>
  9534. Diego Novillo <dnovillo@redhat.com>
  9535. * tree-inline.c (initialize_inlined_parameters): Cast argument
  9536. types appropriately when emitting initialization assignments.
  9537. 2003-04-01 Andrew MacLeod <amacleod@redhat.com>
  9538. * tree-cfg.c (PENDING_STMT, SET_PENDING_STMT): New Macros.
  9539. (bsi_insert_on_edge): Rename to bsi_commit_first_edge_insert. Add an
  9540. empty annotation record to the new basic_block.
  9541. (bsi_commit_edge_inserts): New. Commit all pending edge inserts.
  9542. (bsi_insert_on_edge): New. Add stmt to edge's pending insert list.
  9543. * tree-flow-inline.h (phi_arg_from_edge): Return PHI index for an edge.
  9544. (phi_element_for_edge): Return PHI element for an edge.
  9545. * tree-flow.h (struct var_ann_d): Add auxiallary field and new
  9546. bit 'processed_out_of_ssa'.
  9547. * tree-ssa.c (_var_map): Structure for variable parition map.
  9548. (struct _elim_graph): Elimination graph for out-of-ssa pass.
  9549. (create_var_map): Create a new var_map.
  9550. (delete_var_map): Delete a var_map.
  9551. (var_from_parition): Return var for a specified partition.
  9552. (get_var_partition): Return partition a var belongs to.
  9553. (mapped_var_from_ref): Get root var for a var's partition.
  9554. (compact_var_map): Re-map the partitions to make the list dense.
  9555. (dump_var_parition): Print var_map.
  9556. (set_partition_for_var): Associate a real var with a partition.
  9557. (set_var_mapping): Associate an SSA version var with a real var.
  9558. (create_var_partition): Create a partition for processing.
  9559. (create_temp): Create a new temp variable for a partition.
  9560. (insert_copy_on_edge): Insert a copy between variables on an edge.
  9561. (new_elim_graph): Create a new elimination graph.
  9562. (clear_elim_graph): clear an elimination graph.
  9563. (delete_elim_graph): Delete an elimination graph.
  9564. (eliminate_name, eliminate_build, elim_forward,
  9565. elim_unvisited_predecessor, elim_backward, elim_create,
  9566. eliminate_phi): Routines to implement Morgans PHI elimination algorithm.
  9567. (eliminate_extraneous_phis): Eliminate PHI nodes which will never
  9568. generate code.
  9569. (rewrite_out_of_ssa): Use partitions and PHI elimination algorithm.
  9570. 2003-04-01 Jeff Law <law@redhat.com>
  9571. * tree-cfg.c (make_blocks): Make sure the BIND_EXPR's subgraph
  9572. actually ended in a statement before seeing of the statement should
  9573. end a basic block.
  9574. * tree-cfg.c (dump_tree_cfg): Avoid crashing when cfun is NULL.
  9575. (tree_cfg2dot): Likewise.
  9576. * tree-dfa.c (dump_immediate_uses): Likewise.
  9577. * tree-pretty-print.c (dump_generic_node): Dump the EH_FILTER_FAILURE
  9578. nodes attached to an EH_FILTER_EXPR.
  9579. * tree-dfa.c (get_stmt_operands): Add cases for TRY_FINALLY_EXPR,
  9580. TRY_CATCH_EXPR, CATCH_EXPR and EH_FILTER_EXPR.
  9581. (get_expr_operands): Add case for EXC_PTR_EXPR.
  9582. * tree-dfa.c (compute_may_aliases): Accept FNDECL as an argument.
  9583. Use FNDECL instead of relying on CURRENT_FUNCTION_DECL.
  9584. * tree-flow.h (compute_may_aliases): Update prototype.
  9585. * tree-ssa.c (rewrite_into_ssa): Corresponding changes.
  9586. * tree-inline.c (expand_calls_inline): Correctly handle EH_FILTER_EXPR.
  9587. 2003-03-31 Diego Novillo <dnovillo@redhat.com>
  9588. * Makefile.in (STRICT_WARN, STRICT2_WARN): Remove -Wtraditional.
  9589. * timevar.def (TV_TREE_CLEANUP_CFG): Define.
  9590. * tree-cfg.c (set_parent_stmt): Add documentation.
  9591. (replace_stmt): New function.
  9592. (merge_tree_blocks): New function.
  9593. (remap_stmts): New function.
  9594. (linearize_cond_expr): New function.
  9595. (linearize_control_structures): New function.
  9596. (cleanup_tree_cfg): Call it.
  9597. Use new timevar TV_TREE_CLEANUP_CFG.
  9598. (remove_bb): Update debugging message.
  9599. Make sure that bb->head_tree_p and bb->end_tree_p exist before
  9600. resetting their basic blocks.
  9601. (remove_stmt): When removing a control flow expression, update
  9602. basic block flags.
  9603. (cleanup_control_flow): Make sure that the block contains
  9604. statements.
  9605. (last_stmt): Reformat for readability.
  9606. (last_stmt_ptr): Return NULL if the block has no statements.
  9607. * tree-flow-inline.h (parent_block): Check that the block is not
  9608. empty.
  9609. * tree-flow.h (bb_empty_p): Remove.
  9610. * tree-inline.c (copy_tree_r): Do not copy empty_stmt_node.
  9611. * tree-ssa-dce.c (tree_ssa_dce): Call cleanup_tree_cfg.
  9612. * tree.c (body_is_empty): New function.
  9613. * tree.h (body_is_empty): Declare.
  9614. 2003-03-31 Jeff Law <law@redhat.com>
  9615. * tree-ssa-ccp.c (simulate_block): Add abnormal edges out of a
  9616. block to the edge worklist after simulating a block for the
  9617. first time. If the block has a single outgoing normal edge,
  9618. add that edge to the worklist after simulating the block for
  9619. the first time.
  9620. 2003-03-31 Frank Ch. Eigler <fche@redhat.com>
  9621. * gcc.c (MFLIB_SPEC): Remove -ld.
  9622. (MFWRAP_SPEC): Remove dlopen wrapping.
  9623. 2003-03-28 Diego Novillo <dnovillo@redhat.com>
  9624. * tree-ssa.c (rewrite_block): Add new argument 'eq_expr_value'.
  9625. Update all users.
  9626. If 'eq_expr_value' is given, use it to register a new
  9627. value for the variable given on the LHS.
  9628. If the block ends in a conditional expression of the form 'X == Y',
  9629. propagate 'X = Y' into the THEN_CLAUSE.
  9630. (MAY_COPYPROP_P): Define.
  9631. (rewrite_stmt): Call it.
  9632. (register_new_def): Fix comment.
  9633. (get_eq_expr_value): New function.
  9634. 2003-03-28 Diego Novillo <dnovillo@redhat.com>
  9635. * basic-block.h (BB_COMPOUND_ENTRY): Remove. Update all users
  9636. everywhere.
  9637. * tree-cfg.c: Minor fixes to various comments.
  9638. * tree-optimize.c (optimize_function_tree): Dump optimized function
  9639. after SSA->normal conversion.
  9640. 2003-03-26 Daniel Berlin <dberlin@dberlin.org>
  9641. * tree-ssa-pre.c: Implement open64 renaming algorithm.
  9642. (subst_phis): New function.
  9643. (generate_expr_as_of_bb): Ditto.
  9644. (new_rename_1): Ditto.
  9645. (process_delayed_rename): Ditto.
  9646. (do_proper_save): Use bsi_* functions for insertion, don't remove
  9647. old code quite yet, haven't fully tested.
  9648. Also add argument that says whether to insert before use or after use.
  9649. (defs_y_dom_x): Factor through injuries properly.
  9650. (defs_match_p): Ditto.
  9651. (phi_opnd_from_res): Attempt to fix, and remove useless argument.
  9652. (reset_can_be_avail): Fix broken condition that would cause infinite
  9653. loop.
  9654. (update_old_new): #if 0 updating of bb heads.
  9655. (finalize_1): We occasionally get 5 + a rather than a + 5, so we
  9656. need to make sure 5 is a DECL before trying to get a reaching def.
  9657. (repair_use_injury): If we couldn't find a reaching def, we don't need
  9658. to repair it.
  9659. (assign_new_class): Only push to stack2 if it exists (so we can
  9660. share this function in both rename implementations).
  9661. (create_ephi_node): Add argument that says whether to add ephi
  9662. to block or not (we create them sometimes for validation only).
  9663. (tree_perform_ssapre): Skip expressions without any uses.
  9664. * tree.h: Add EREF_DELAYED_RENAME.
  9665. (struct tree_eref_common): Add delayed_rename bit.
  9666. 2003-03-25 Diego Novillo <dnovillo@redhat.com>
  9667. * tree-simple.c: Use tree codes to document grammar for relational
  9668. operators &&, || and ^.
  9669. 2003-03-25 Diego Novillo <dnovillo@redhat.com>
  9670. * cfg.c (dump_edge_info): Add labels for EDGE_TRUE_VALUE,
  9671. EDGE_FALSE_VALUE and EDGE_EXECUTABLE.
  9672. * tree-cfg.c (dump_tree_bb): Change formatting. Show all
  9673. statements in the block.
  9674. * tree-simple.c: Update documentation for GIMPLE conditional
  9675. expressions.
  9676. 2003-03-24 Diego Novillo <dnovillo@redhat.com>
  9677. * tree-dfa.c (get_expr_operands): If there are no call clobbered
  9678. variables, don't create a VDEF for GLOBAL_VAR at clobbering
  9679. CALL_EXPRS.
  9680. * tree-flow.h (fold_stmt): Declare.
  9681. * tree-ssa-ccp.c (fold_stmt): Change to extern declaration.
  9682. * tree-ssa.c (rewrite_stmt): Call it.
  9683. 2003-03-22 Diego Novillo <dnovillo@redhat.com>
  9684. * Makefile.in (gtype-desc.o): Add dependency on $(TREE_FLOW_H).
  9685. * tree-dfa.c (struct alias_set_d): Add field 'num_elements'.
  9686. (struct walk_state): Move declaration earlier in the file.
  9687. (create_global_var): New local function.
  9688. (num_referenced_vars, num_aliased_objects): Change type to
  9689. 'size_t'. Update all users.
  9690. (aliased_objects, aliased_objects_base, aliased_objects_aliase_set):
  9691. Mark for garbage collection.
  9692. (num_call_clobbered_vars, call_clobbered_vars): New global
  9693. variable.
  9694. (get_expr_operands): For CALL_EXPRs, add a VUSE or VDEF reference
  9695. for every pointer argument. If the call may clobber, add a VDEF,
  9696. otherwise add a VUSE.
  9697. If the call may clobber, add VDEF for GLOBAL_VAR.
  9698. (dump_variable): Show whether the variable is call clobbered.
  9699. (dump_dfa_stats): Show call clobbered variables.
  9700. (compute_may_aliases): Minor formatting changes.
  9701. (compute_alias_sets): If the function makes clobbering calls, add
  9702. GLOBAL_VAR as an alias to every call-clobbered variable.
  9703. Remove alias sets that have exactly one element.
  9704. (register_alias_set): Set 'num_elements' to zero for every newly
  9705. created alias set.
  9706. (find_alias_for): Don't make a second call to add_may_alias to make
  9707. alias tags alias themselves. It's redundant.
  9708. Increment 'num_elements' when adding a new alias to an alias set.
  9709. (may_alias_p): Don't handle GLOBAL_VAR.
  9710. Check for structure aliasing when either PTR or VAR are a
  9711. structure. Don't do it only when both are structures.
  9712. (dump_alias_info): Show all aliases of each variable.
  9713. (find_vars_r): When processing a CALL_EXPR node, set
  9714. walk_state->is_store if the function may clobber and create a
  9715. reference to GLOBAL_VAR.
  9716. (add_indirect_ref_var): Change type of second argument from 'void *'
  9717. to 'struct walk_state *'. Update all users.
  9718. (add_referenced_var): Likewise. If a potentially aliased variabe
  9719. is not declared 'const', add it to the list of call clobbered
  9720. variables.
  9721. * tree-flow.h (struct var_ann_d): Add field 'is_call_clobbered'.
  9722. Change type of field 'uid' to size_t. Update all users.
  9723. (stmt_ann_d): Add field 'makes_clobbering_call'.
  9724. (next_tree_ref_id): Remove unused variable.
  9725. (call_clobbered_vars): Declare.
  9726. (num_call_clobbered_vars): Declare.
  9727. (call_clobbered_var): New inline function.
  9728. * tree-ssa-ccp.c (visit_phi_node): If the LHS of a PHI node is
  9729. volatile, mark the PHI node VARYING without checking its arguments.
  9730. (visit_assignment): Likewise.
  9731. (set_value): Remove. Update all users.
  9732. (likely_value): If the statement makes aliased loads or has
  9733. volatile operands, consider it VARYING.
  9734. (get_default_value): If a variable is volatile, consider it
  9735. VARYING.
  9736. * tree-ssa.c (init_tree_ssa): Initialize num_call_clobbered_vars
  9737. and call_clobbered_vars.
  9738. Do not create GLOBAL_VAR. Set it to NULL_TREE.
  9739. Increase initial size for various hash tables.
  9740. (delete_tree_ssa): Reset num_call_clobbered_vars and
  9741. call_clobbered_vars.
  9742. (get_reaching_def): Rename from currdef_for. Update all users.
  9743. Always create default definitions for variables that need them.
  9744. Callers that use to call currdef_for with the second argument set
  9745. to false now call get_value_for.
  9746. (htab_statistics): New function.
  9747. (dump_tree_ssa): Call it.
  9748. (avail_expr_eq): Also compare VUSE operands.
  9749. 2003-03-21 Jeff Law <law@redhat.com>
  9750. * tree-dfa.c: Revert vla changes from yesterday.
  9751. (find_vla_decls_r): Do not look inside TYPE_DECLs.
  9752. 2003-03-20 Jeff Law <law@redhat.com>
  9753. * gimplify.c (simplify_return_expr): Tighten condition for
  9754. converting the RHS of a MODIFY_EXPR in a RETURN_EXPR to a
  9755. simple_val. Allow returning a RESULT_DECL directly.
  9756. * tree-dfa.c (get_expr_operands): A RESULT_DECL can have
  9757. interesting operands.
  9758. (clobber_vars_r): Handle RESULT_DECLs.
  9759. (compute_may_aliases): Initialize and free vla_htab.
  9760. (find_vla_decls): Pass vla_htab to walk_tree.
  9761. (find_vla_decls_r): Likewise.
  9762. * tree.h (SSA_DECL_P): Accept RESULT_DECLs.
  9763. 2003-03-19 Jeff Law <law@redhat.com>
  9764. * gimplify.c (simplify_return_expr): Only allow simple values
  9765. on the RHS of a MODIFY_EXPR appearing in a RETURN_EXPR.
  9766. * tree-cfg.c (make_exit_edges): We no longer need to look for
  9767. CALL_EXPRs on the RHS of a MODIFY_EXPR inside RETURN_EXPRs.
  9768. 2003-03-18 Andrew Macleod <amacleod@redhat.com>
  9769. * tree-cfg.c (make_blocks): Use append_stmt_to_bb. Check for NULL
  9770. tsi_stmt when deciding whether to start a new block.
  9771. (add_stmt_to_bb): Don't update the basic block end pointer.
  9772. (append_stmt_to_bb): New. Add stmt and update the BB end pointer.
  9773. (first_stmt): Use only 1 return.
  9774. (last_stmt): Modified to use bsi_last().
  9775. (last_stmt_ptr): Modified to use bsi_last().
  9776. (bsi_last): New. Return an iterator to the last stmt in a block.
  9777. (bsi_from_tsi): Fix bug which wouldn't set the context properly when
  9778. within a nested BIND_EXPR.
  9779. (bsi_update_from_tsi): Insert helper which is more efficient than
  9780. bsi_from_tsi().
  9781. (bsi_link_after): link in a new stmt and update the basic block
  9782. data structures.
  9783. (bsi_insert_after): Insert a new stmt into a block.
  9784. (bsi_insert_before): Insert a new stmt into a block.
  9785. (bsi_insert_on_edge): Insert a new stmt on an edge.
  9786. * tree-flow-inline.h (is_label_stmt): Return true if stmt can be a
  9787. target of a control transfer.
  9788. * tree-flow.h (is_label_stmt, bsi_last): New prototypes.
  9789. 2003-03-12 Jeff Law <law@redhat.com>
  9790. * c-simplify.c (simplify_switch_stmt): Save the type of the original
  9791. condition in TREE_TYPE (SWITCH_EXPR (...)). Annotate the SWITCH_EXPR
  9792. with file/line information.
  9793. * expr.c (expand_expr, case SWITCH_EXPR): Use expand_end_case_type.
  9794. * tree.def (SWITCH_EXPR): Document meaning of TREE_TYPE field of
  9795. the SWITCH_EXPR.
  9796. * c-simplify.c (simplify_block): Set the current line number to
  9797. the line associated with the end of the block.
  9798. * c-decl.c (finish_function): No longer save/restore the
  9799. current filename or linenumber around simplification. Instead
  9800. save/restore it around inlining.
  9801. (c_expand_body_1): Save/restore current filename and linenumber
  9802. around expansion of trees into RTL.
  9803. * gimplify.c (simplify_function_tree): Make the current file/line
  9804. number match the non-gimple code at the end of a function.
  9805. * tree-cfg.c: Include toplev.h.
  9806. (remove_bb): Warn about unreachable code.
  9807. * cfgrtl.c (verify_flow_info): Ignore EDGE_EXECUTABLE, it's for
  9808. the CCP optimizer only.
  9809. * ssa.c (convert_to_ssa): Use last_basic_block, not n_basic_blocks.
  9810. 2003-03-11 Jeff Law <law@redhat.com>
  9811. * builtins.c: Fix minor comment typo.
  9812. (expand_builtin_strcmp, expand_builtin_strncmp): Remove.
  9813. (expand_builtin_strcat, expand_builtin_strncat): Likewise.
  9814. (expand_builtin_strspn, expand_builtin_strcspn): Likewise.
  9815. (expand_builtin_strcopy, expand_builtin_strstr): Likewise.
  9816. (expand_builtin_strpbrk, expand_builtin_strchr): Likewise.
  9817. (expand_builtin_strrchr, expand_builtin_fputs): Likewise.
  9818. (simplify_builtin_memcmp, simplify_builtin_strcmp): New functions.
  9819. (simplify_builtin_strpbrk, simplify_builtin_strstr): Likewise
  9820. (simplify_builtin_strchr, simplify_builtin_strrchr): Likewise
  9821. (simplify_builtin_strcpy, simplify_builtin_strncpy): Likewise
  9822. (simplify_builtin_strncmp, simplify_builtin_strcat): Likewise
  9823. (simplify_builtin_strncat, simplify_builtin_strspn): Likewise
  9824. (simplify_builtin_strcspn, simplify_builtin_fputs): Likewise
  9825. (expand_builtin_memcmp): Use simplify_builtin_memcmp.
  9826. (simplify_builtin): New function
  9827. (expand_builtin): Use simpify_builtin to collapse several common
  9828. cases together.
  9829. * gimplify.c (simplify_call_expr): Accept new argument. All
  9830. callers updated. Call simplify_builtin to try and simplify builtin
  9831. function calls before we simplify their arguments.
  9832. * tree.h (simplify_builtin): Prototype.
  9833. 2003-03-11 Jeff Law <law@redhat.com>
  9834. * timevar.def (TV_TREE_SSA_TO_NORMAL): New timevar.
  9835. * tree-cfg.c (remove_stmt): Also remove special annotations
  9836. on RHS of MODIFY_EXPR statements.
  9837. * tree-dfa.c (create_stmt_ann): Update comments. Fix formatting.
  9838. (compute_may_aliases): Make sure timevar encloses entire routine.
  9839. * tree-ssa.c (rewrite_out_of_ssa): Enclose with a timevar.
  9840. (remove_annotations_r): Avoid walking into subtrees of anything
  9841. except container nodes. Remove the special annotation on the
  9842. RHS of MODIFY_EXPRs.
  9843. 2003-03-10 Frank Ch. Eigler <fche@redhat.com>
  9844. * tree-mudflap.c (mx_xfn_indirect_ref): Allow unfolded "& ptr->field"
  9845. constructs to pass uninstrumented. Remove TREE_ADDRESSABLE settings.
  9846. Keep array accesses to non-ADDRESSABLE objects uninstrumented. Update
  9847. __MF_TYPE_* constants for __mf_register calls.
  9848. 2003-03-10 Jeff Law <law@redhat.com>
  9849. * c-decl.c (c_expand_body_1): Update comments relating to
  9850. re-simplification after mudflap instrumentation. Avoid
  9851. unnecessary simplification of the function tree.
  9852. * gimplify.c (keep_function_tree_in_gimple_form): New function.
  9853. * tree-inline.c: Include tree-iterator.h and tree-simple.h
  9854. (struct inline_data): Add new TSI field.
  9855. (copy_body_r): Keep tree in gimple form when transforming a
  9856. RETURN_EXPR into a MODIFY_EXPR and GOTO_EXPR.
  9857. (initialize_inlined_parameters): Use MODIFY_EXPR, not INIT_EXPR
  9858. for initialization of inlined parameters.
  9859. (expand_call_inline): Save and restore the TSI around the
  9860. call to expand_calls_inline. Keep the tree in gimple form
  9861. when replacing a CALL_EXPR with a BIND_EXPR for the inlined
  9862. body.
  9863. (expand_calls_inline): Revamp to provide the current TSI to
  9864. expand_call_inline when we're working with gimple form.
  9865. * Makefile.in (tree-inline.o): Update dependencies.
  9866. * tree.h (keep_function_tree_in_gimple_form): Prototype.
  9867. 2003-03-10 Andrew MacLeod <amacleod@redhat.com>
  9868. * Makefile.in (tree.o): Add tree-iterator.h dependancy.
  9869. * sbitmap.c (sbitmap_realloc): Grow a sbitmap structure.
  9870. * sbitmap.h (sbitmap_realloc): New Prototype.
  9871. * tree-cfg.c (remove_bb): Use new format for bsi_remove.
  9872. (bsi_remove): Update iterator to refer to the next stmt.
  9873. (bsi_prev): Implement previous stmt routine.
  9874. (bsi_from_tsi): Create a block iterator from a tree iterator.
  9875. * tree-flow-inline.h (bsi_prev): Remove.
  9876. (tsi_from_bsi): Create a tree iterator from a block iterator.
  9877. * tree-flow.h (bsi_prev,bsi_remove): Update prototypes.
  9878. (bsi_from_tsi, tsi_from_bsi, bsi_insert_*): New prototypes.
  9879. (bsi_iterator_update): New enum type.
  9880. * tree-iterator.h (tree_stmt_anchor, tsi_iterator_update): New type.
  9881. (tsi_link_before, tsi_link_after, tsi_delink, tsi_new_stmt_list,
  9882. tsi_stmt_list_head): New prototypes.
  9883. * tree-ssa-dce.c (remove_dead_stmts): Update removal loop to allow
  9884. that remove_dead_stmt update's the iterator.
  9885. (remove_dead_stmt): Use a pointer to the iterator since bsi_remove
  9886. requires it.
  9887. * tree.c (tsi_link_before): New function to link a stmt before an
  9888. iterator.
  9889. (tsi_link_after): New function links stmt after an iterator.
  9890. (tsi_delink): Removes a stmt from a list.
  9891. (tsi_new_stmt_list): New function to begin a new stmt list.
  9892. (tsi_stmt_list_head): New function to get the first stmt in a list.
  9893. 2003-03-07 Diego Novillo <dnovillo@redhat.com>
  9894. * tree-cfg.c (remove_stmt): Don't assume that the statement is in
  9895. SSA form.
  9896. * tree-flow.h (dump_tree_ssa_stats): Declare.
  9897. (debug_tree_ssa_stats): Declare.
  9898. (stmt_ann_d): Add new statement flags 'makes_aliased_loads',
  9899. 'makes_aliased_stores', and 'has_volatile_ops'.
  9900. * tree-dfa.c (add_stmt_operand): Set new statement flags accordingly.
  9901. * tree-pretty-print.c (dump_generic_node): Various cosmetic changes
  9902. to the rendering of some expressions.
  9903. * tree-ssa.c (struct var_value_d): Rename from struct currdef_d.
  9904. Rename field 'currdef' to 'value'. Update all users.
  9905. (avail_exprs): New local hash table.
  9906. (const_and_copies): New local hash table.
  9907. (struct ssa_stats_d): Declare.
  9908. (ssa_stats): New local variable.
  9909. (rewrite_into_ssa): Deallocate avail_exprs and const_and_copies
  9910. after renaming.
  9911. Call dump_tree_ssa_stats() if -fdump-tree-ssa-stats is given.
  9912. (rewrite_block): Document the renaming process.
  9913. Add new local stack block_avail_exprs to keep track of expressions
  9914. made available in this block and its children.
  9915. (rewrite_stmts): Move body inside rewrite_block.
  9916. (dump_tree_ssa_stats): New function.
  9917. (debug_tree_ssa_stats): New function.
  9918. (get_def_blocks): New function.
  9919. (insert_phi_nodes_for): Call it.
  9920. (rewrite_stmt): Add support for keeping track of copies, constants
  9921. and globally redundant expressions.
  9922. (rewrite_operand): If a pointer has been copy propagated into
  9923. another one, rewrite INDIRECT_REF nodes of the original pointer to
  9924. refer to the new one.
  9925. (register_new_def): Add new argument 'var' indicating which
  9926. variable is this new definition for. Update all users.
  9927. (update_indirect_ref_vuses): New function.
  9928. (update_pointer_vuses): New function.
  9929. (init_tree_ssa): Set variable 'ssa_stats' to zero.
  9930. Allocate memory for 'avail_exprs' and 'const_and_copies'.
  9931. (currdef_for): Don't mark inline.
  9932. Call get_value_for and set_value_for.
  9933. (set_currdef_for): Remove. Update all users.
  9934. (var_value_hash): Rename from currdef_hash. Update all users.
  9935. (var_value_eq): Rename from currdef_eq. Update all users.
  9936. (get_value_for): New function.
  9937. (set_value_for): New function.
  9938. (lookup_avail_expr): New function.
  9939. (avail_expr_hash): New function.
  9940. (avail_expr_eq): New function.
  9941. (get_def_blocks_for): New function.
  9942. (var_is_live): New function.
  9943. 2003-03-06 Diego Novillo <dnovillo@redhat.com>
  9944. * tree-ssa-ccp.c (likely_value): Don't assume CONSTANT if the
  9945. statement has virtual uses.
  9946. 2003-03-05 Diego Novillo <dnovillo@redhat.com>
  9947. * tree-dfa.c (opf_none, opf_is_def, opf_force_vop, opf_ignore_bp):
  9948. New flags to alter the behavior of add_stmt_operand.
  9949. (get_expr_operands): Change operand IS_DEF with FLAGS. Update all
  9950. users.
  9951. When adding a VUSE for pointer dereferences in function arguments,
  9952. don't add a superfluous VUSE for the base pointer.
  9953. (add_stmt_operand): Remove operands IS_DEF and FORCE_VOP. Add
  9954. operand FLAGS. Update all users.
  9955. 2003-03-05 Jason Merrill <jason@redhat.com>
  9956. * c-pretty-print.c (do_niy): Only print operands of expressions.
  9957. * tree-pretty-print.c: Likewise.
  9958. * c-simplify.c (simplify_decl_stmt): Only simplify DECL_SIZE_UNIT.
  9959. * gimplify.c (simplify_array_ref_to_plus): New fn.
  9960. (simplify_array_ref): Use it.
  9961. (build_addr_expr_with_type): Split out from build_addr_expr.
  9962. (simplify_compound_lval): Break out an ARRAY_REF with non-constant
  9963. element size.
  9964. 2003-03-05 Frank Ch. Eigler <fche@redhat.com>
  9965. * gcc.c (MFWRAP_SPEC): Remove most --wrap entries.
  9966. 2003-03-03 Daniel Berlin <dberlin@dberlin.org>
  9967. * tree-ssa-pre.c (is_strred_cand): Temporarily disable strength
  9968. reduction while working on bootstrapping.
  9969. (requires_edge_placement): Reenable for now, until an insertion
  9970. infrastructure exists that can handle critical edges.
  9971. (count_stmts_in_bb): New function, used for verifying we do
  9972. insertions properly.
  9973. (update_old_new): Fix up bb heads as well.
  9974. (do_proper_save): Handle single statement bb properly.
  9975. Handle BB's contained in BIND_EXPRS.
  9976. (code_motion): Count number of statements in bb before and after
  9977. to make sure we don't screw up boundaries.
  9978. (finalize_1): Ditto.
  9979. (rename_2): Fix subtle rename bug.
  9980. (phi_opnd_from_res): Do this the right way, by cloning the
  9981. occurrence and modifying it, as every other PRE implementation
  9982. does.
  9983. (tree_perform_ssapre): Handle comparisons too (unary exprs
  9984. currently disabled till load PRE is reimplemented).
  9985. (reset_can_be_avail): Fix can_be_avail test.
  9986. 2003-03-01 Diego Novillo <dnovillo@redhat.com>
  9987. * doc/invoke.texi: Fix typo.
  9988. 2003-02-28 Aldy Hernandez <aldyh@redhat.com>
  9989. Diego Novillo <dnovillo@redhat.com>
  9990. * Makefile.in (OBJS): Add tree-ssa-copyprop.o.
  9991. (tree-ssa-copyprop.o): New rule.
  9992. (tree-ssa-ccp.o): Add dependency on $(TREE_SIMPLE_H).
  9993. * timevar.def (TV_TREE_COPYPROP): New timevar.
  9994. * flags.h (flag_tree_copyprop): Declare.
  9995. * toplev.c (flag_tree_copyprop): Define.
  9996. (f_options): Add -ftree-copyprop.
  9997. * tree.h (tree_dump_index): Add TDI_copyprop.
  9998. * tree-dump.c (dump_files): Add entry for -fdump-tree-copyprop.
  9999. * doc/invoke.texi: Document -ftree-copyprop and -fdump-tree-copyprop.
  10000. * tree-ssa-copyprop.c: New file.
  10001. * tree-flow.h (tree_ssa_copyprop): Declare.
  10002. * tree-optimize.c (optimize_function_tree): Call it.
  10003. * tree-dfa.c (add_vuse): Make extern. Update all users.
  10004. * tree-ssa.c (mark_def_sites): VUSEs are stored in a varray of trees.
  10005. 2003-02-28 Frank Ch. Eigler <fche@redhat.com>
  10006. * tree-mudflap.c (mudflap_enqueue_decl): Ignore extern artificial
  10007. variable declarations.
  10008. 2003-02-27 Diego Novillo <dnovillo@redhat.com>
  10009. * tree-dfa.c (get_stmt_operands): INIT_EXPR nodes cannot
  10010. appear in GIMPLE form. Don't handle them.
  10011. (get_expr_operands): Likewise.
  10012. (find_vars_r): Likewise.
  10013. * tree-ssa-ccp.c (get_rhs): Likewise.
  10014. (set_rhs): Likewise.
  10015. * tree-ssa-pre.c (tree_perform_ssapre): Likewise.
  10016. 2003-02-27 Diego Novillo <dnovillo@redhat.com>
  10017. * tree-ssa-ccp.c (ccp_fold): Fold builtins by replacing and
  10018. restoring their arguments.
  10019. 2003-02-27 Jeff Law <law@redhat.com>
  10020. * tree-dfa.c (find_vars_r): Clear *walk_subtrees appropriately
  10021. to avoid useless walking of subtrees.
  10022. * fold-const.c (nondestructive_fold_binary_to_constant): Renamed
  10023. from nondestructive_fold_binary. Update comments slightly.
  10024. (nondestructive_fold_unary_to_constant): Similarly.
  10025. (fold_relational_hi_lo): Corresponding changes.
  10026. * tree-ssa-ccp.c (ccp_fold): Corresponding changes.
  10027. * tree.h: Corresponding changes.
  10028. 2003-02-26 Jeff Law <law@redhat.com>
  10029. * tree-ssa-ccp.c (ccp_fold): Also handle folding of calls to
  10030. builtin functions.
  10031. * fold-const.c (nondestructive_fold_binary): Handle truth ops
  10032. when both arguments are constant (duh!). Handle CONJ_EXPR.
  10033. 2003-02-26 Daniel Berlin <dberlin@dberlin.org>
  10034. * flags.h: Remove flag_ip.
  10035. * toplev.c: Ditto.
  10036. * tree-alias-ander.c: s/flag_ip/flag_unit_at_a_time/g.
  10037. (andersen_cleanup): Set region to null when done.
  10038. (andersen_function_call): Check DECL_PTA_TYPEVAR, not
  10039. DECL_SAVED_TREE.
  10040. * tree-alias-common.c: s/SSA_DECL_P/DECL_P/g.
  10041. (get_alias_var_decl): Remove dead code, fix bug in what is a
  10042. local alias var.
  10043. (find_func_aliases): Use get_alias_var, not create_fun_alias_var.
  10044. (create_fun_alias_var): Fix to use DECL_PTA_TYPEVAR.
  10045. Use get_alias_var rather than create_alias_var.
  10046. (create_fun_alias_var_ptf): Ditto.
  10047. (create_alias_vars): Ditto.
  10048. * tree-dfa.c (compute_may_aliases): Fix check for
  10049. create_alias_vars.
  10050. Move deletion of alias vars back to here, from tree-ssa.c
  10051. * tree-ssa.c (delete_tree_ssa): Remove delete_alias_vars call.
  10052. 2003-02-25 Jeff Law <law@redhat.com>
  10053. Diego Novillo <dnovillo@redhat.com>
  10054. * tree-ssa-ccp.c (likely_value): If the statement has no
  10055. use operands, then return CONSTANT.
  10056. * fold-const.c (nondestructive_fold_binary): Handle TRUTH_AND_EXPR
  10057. and TRUTH_OR_EXPR. Placeholder for TRUTH_XOR_EXPR.
  10058. * tree-ssa-ccp.c (ccp_fold): Handle TRUTH_{AND,OR,XOR}_EXPR.
  10059. (def_to_undefined): Re-enable VARYING->UNDEFINED state transition
  10060. sanity check.
  10061. * tree-ssa-ccp.c (likely_value): Renamed from may_fold_p. Now
  10062. returns a latticevalue indicating the likely value for the
  10063. the RHS of the statement.
  10064. (evaluate_stmt): Update to use likely_value instead of may_fold_p.
  10065. Statements with UNDEFINED operands produce an UNDEFINED result.
  10066. (set_lattice_value): Reenable VARYING->CONSTANT sanity check.
  10067. 2003-02-25 Andrew MacLeod <amacleod@redhat.com>
  10068. * tree-cfg.c (bsi_init): Handle BIND_EXPR nodes inside a basic block.
  10069. (bsi_next_in_bb): Likewise.
  10070. 2003-02-25 Diego Novillo <dnovillo@redhat.com>
  10071. * tree-cfg.c (parent_array): Remove. Update all users.
  10072. (struct cfg_stats_d): Add field 'num_failed_bind_expr_merges'.
  10073. (NEXT_BLOCK_LINK): Define.
  10074. (build_tree_cfg): Call alloc_aux_for_blocks instead of
  10075. create_block_annotations.
  10076. (make_blocks): Rewrite to support basic blocks that can span whole
  10077. BIND_EXPR bodies and put control statements at the end of blocks.
  10078. Add arguments 'next_block_link' and 'bb'. Replace 'parent_block'
  10079. with 'parent_stmt'. Update all users.
  10080. (make_loop_expr_blocks): Replace argument 'parent_block' with 'entry'.
  10081. Add argument 'next_block_link'. Update all users.
  10082. Don't create an empty latch block.
  10083. (make_cond_expr_blocks): Add argument 'next_block_link'. Update
  10084. all users.
  10085. (make_switch_expr_blocks): Likewise.
  10086. (make_bind_expr_blocks): Replace 'parent_block' with 'parent_stmt'.
  10087. Add argument 'next_block_link' and 'entry'.
  10088. Don't create a new block for the BIND_EXPR node. Extend the
  10089. existing block.
  10090. (add_stmt_to_bb): New function.
  10091. (create_bb): Remove argument 'parent_block'. Update all users.
  10092. (create_block_annotations): Remove. Update all users.
  10093. (make_edges): Don't handle BIND_EXPR nodes.
  10094. (make_ctrl_stmt_edges): Don't create an extra edge to the body of
  10095. the switch.
  10096. (make_loop_expr_edges): Only create an edge to the body of the
  10097. loop.
  10098. (remove_unreachable_block): Add more documentation for the special
  10099. case where a control statement entry is unreachable but its body
  10100. isn't.
  10101. Remove the basic block annotation from the head and end containers
  10102. in the block.
  10103. (disconnect_unreachable_case_labels): Don't keep the edge that goes
  10104. to the BIND_EXPR at the start of the switch body.
  10105. (dump_tree_bb): Call is_latch_block_for.
  10106. (dump_cfg_stats): Show stats about basic blocks that could not span
  10107. beyond the end of a BIND_EXPR body.
  10108. (successor_block): Use NEXT_BLOCK_LINK if the block is the last
  10109. inside a control structure.
  10110. (is_ctrl_stmt): Update documentation.
  10111. (stmt_starts_bb_p): Add new argument 'prev_t'. Update all users.
  10112. Only labels may start a new basic block.
  10113. (stmt_ends_bb_p): Add LOOP_EXPR, TRY_FINALLY_EXPR and
  10114. TRY_CATCH_EXPR to the list.
  10115. (latch_block): Remove.
  10116. (is_latch_block_for): New function.
  10117. (set_bb_for_stmt): Reformat some code.
  10118. * tree-flow-inline.h (set_parent_block): Remove. Update all users.
  10119. (parent_stmt): New function.
  10120. (parent_block): Call it.
  10121. * tree-flow.h (struct stmt_ann_d): Add field 'parent_stmt'.
  10122. (struct bb_ann_d): Remove block parent_block.
  10123. * tree-pretty-print.c (dump_generic_node): Don't handle empty latch
  10124. nodes.
  10125. * tree-ssa-ccp.c (def_to_undefined): Temporarily disable check for
  10126. VARYING->UNDEFINED transitions.
  10127. (set_lattice_value): Likewise for VARYING->CONSTANT transitions.
  10128. * tree-ssa-dce.c (mark_necessary): Use parent_stmt() to traverse
  10129. all the control statements that contain the current
  10130. statement.
  10131. (makr_control_parent_necessary): Remove. Update all users.
  10132. (stmt_useful_p): Add BIND_EXPR to the list of useful
  10133. statements.
  10134. (process_worklist): Check that the statement is
  10135. associated to a basic block.
  10136. (remove_dead_stmt): Don't assume that the block has a
  10137. postdominator.
  10138. 2002-02-20 Daniel Berlin <dberlin@dberlin.org>
  10139. * tree-alias-ander.c: Store cached ptsets in the typevar, not
  10140. a seperate hash table.
  10141. (ptset_map): Removed;
  10142. (ptset_map_eq): Ditto.
  10143. (ptset_map_hash): Ditto.
  10144. (andersen_init): Remove ptset_map.
  10145. (andersen_cleanup): Ditto.
  10146. (andersen_add_var): Ditto.
  10147. (andersen_add_var_asm): Ditto.
  10148. (andersen_may_alias): Ditto.
  10149. * tree-alias-common.c: Store typevars for DECL nodes in the tree_decl
  10150. structure.
  10151. (get_alias_var_decl): Use DECL_PTA_TYPEVAR for DECL's.
  10152. (create_alias_var): Ditto.
  10153. (find_func_aliases): CONST functions don't affect aliasing either.
  10154. (ptr_may_alias_var): Don't call get_base_symbol.
  10155. Remove decl_function_context, use DECL_CONTEXT instead.
  10156. For DECL's, use DECL_PTA_TYPEVAR.
  10157. * tree-alias-type.c (struct alias_typevar_aterm): Add ptset member.
  10158. (ALIAS_TVAR_PTSET): New macro.
  10159. * tree.h (DECL_PTA_TYPEVAR): New macro.
  10160. (struct tree_decl): Add typevar member.
  10161. 2003-02-20 Jeff Law <law@redhat.com>
  10162. * c-simplify.c (simplify_decl_stmt): Call set_vla_decl on the
  10163. temporary holding the size and unit size for a VLA. Minor
  10164. formatting fixes.
  10165. * ssa.c: Revert caching of immediate dominators change made on
  10166. Jan 28, 2003.
  10167. * tree-dfa.c: Fix comment.
  10168. 2003-02-20 Jeff Law <law@redhat.com>
  10169. * tree-cfg.c (remove_bb): Update PHI nodes as edges are removed.
  10170. (cleanup_cond_expr_graph): Likewise.
  10171. (cleanup_switch_expr_graph): Likewise.
  10172. (disconnect_unreachable_case_labels): Likewise.
  10173. * tree-ssa-dce.c (mark_control_parent_necessary): Be much more
  10174. selective about what statements in the control parents are marked
  10175. as necessary.
  10176. * tree-dfa.c (INDIRECT_REFs and ADDRESSABLE_VARs varrays): Replace
  10177. with a single ALIASED_OBJECTs set of varrays.
  10178. (dump_dfa_stats): Corresponding changes.
  10179. (compute_may_aliases, dump_alias_info): Likewise.
  10180. (compute_alias_sets): Likesise. Update comments. Register
  10181. alias sets for all potentially aliased objects which are stored.
  10182. Check each potentially aliased object with the registered alias
  10183. sets.
  10184. (register_alias_set): If DEREF aliases a single registered _DECL,
  10185. then replace the _DECL's entry with DEREF.
  10186. (find_alias_for): Update comments. Do not stop the search when
  10187. an alias is found. There may be multiple entries with conflicting
  10188. alias sets.
  10189. (struct walk_state): New structure for statement walker callbacks.
  10190. (find_vars_r): Add logic to track loads and stores of potentially
  10191. aliased objects separately. Various changes related to
  10192. using a single set of varrays for all aliased objects.
  10193. (add_referenced_var): Record in the var's annotation if the
  10194. var is read or written. Various changes related to using a
  10195. single set of varrays for all the aliased objects.
  10196. (add_stmt_operand): Only set may_point_to_global_mem for INDIRECT_REFs.
  10197. * tree-flow.h (struct var_ann_d): Add new fields indicating if
  10198. the var is loaded or stored. Explicitly note unused bitfield
  10199. entries.
  10200. 2003-02-19 Jeff Law <law@redhat.com>
  10201. * fold-const.c (fold_negate_const): New function. Broken out of
  10202. the generic fold code.
  10203. (fold_abs_const, fold_relational_const): Likewise.
  10204. (fold_relational_hi_lo): Likewise.
  10205. (nondestructive_fold_unary, nondestructive_fold_binary): Likewise.
  10206. (fold): Use fold_negate_const, fold_abs_const, fold_relational_const,
  10207. and fold_relational_hi_lo.
  10208. * tree.h (nondestructive_fold_unary): Declare.
  10209. (nondestructive_fold_binary): Declare.
  10210. * tree-ssa-ccp.c (ccp_fold): New function.
  10211. (add_control_edge): Fix trivial formatting bug.
  10212. (evaluate_stmt): Rework to use ccp_fold instead of copying
  10213. statements.
  10214. 2003-02-18 Jeff Law <law@redhat.com>
  10215. * tree-ssa-ccp.c (visit_assignment): For simple copies, copy the
  10216. lattice values.
  10217. (defs_to_undefined): Add missing abort.
  10218. (replace_uses_in): Do not do a replacement if it would create
  10219. non GIMPLE trees.
  10220. 2002-02-14 Jeff Law <law@redhat.com>
  10221. * tree-ssa-ccp.c (def_to_undefined): Improve sanity checking code
  10222. so that it can detect invalid VARYING->UNDEFINED transitions.
  10223. (set_lattice_value): Improve sanity checking code so that it
  10224. does not trip on valid VARYING->CONSTANT transitions.
  10225. * tree-flow.h (struct stmt_ann_d): Add new field in_ccp_worklist.
  10226. * tree-ssa-ccp.c (simulate_stmt): Renamed from simulate_def_use_edges.
  10227. (add_var_to_ssa_edges_worklist): New function. Only add statements
  10228. to the ssa_edges worklist if they are not already on the worklist.
  10229. (def_to_undefined, def_to_varying, set_lattice_value)
  10230. (tree_ssa_ccp): Only reevaluate the statement if in_ccp_worklist
  10231. is set for the element popped off the ssa_edges worklist.
  10232. (simulate_statement): Simplify now that ssa_edges is a worklist
  10233. of statements to reevaluate rather than a worklist of defs
  10234. that need their immediate uses reevaluated.
  10235. (visit_stmt): Clear in_ccp_worklist.
  10236. * tree-ssa-ccp.c (def_to_undefined): Directly store the new
  10237. lattice values rather than call set_value.
  10238. (def_to_varying): Likewise.
  10239. (set_lattice_value): Likewise.
  10240. * tree-ssa-ccp.c (def_to_undefined): Add some state transition
  10241. sanity checking. Avoid calling set_value if nothing changed.
  10242. (def_to_varying): Avoid calling set_value if nothing changed.
  10243. (set_lattice_value): Add some state transition sanity checking
  10244. for transitions into the CONSTANT state. If the object's
  10245. "constant" value has changed to a new constant value, then the
  10246. object has a VARYING value.
  10247. * tree-ssa-ccp.c (tree_ssa_ccp): Work through the entire
  10248. ssa_edges worklist each iteration through the main loop.
  10249. 2002-02-13 Jeff Law <law@redhat.com>
  10250. * tree-ssa-ccp.c: Fix comment formatting glitches.
  10251. * tree-ssa-ccp.c (may_fold_p): New function. Returns nonzero if
  10252. the given statement may fold after replacement of operands with
  10253. constants.
  10254. (evaluate_stmt): Only create a copy of the statement if there is
  10255. a reasonable chance the statement will fold.
  10256. 2002-02-13 Diego Novillo <dnovillo@redhat.com>
  10257. * Makefile.in (OBJS): Add tree-ssa-pre.o.
  10258. 2003-02-13 Daniel Berlin <dberlin@dberlin.org>
  10259. * tree-dfa.c (create_stmt_ann): Do stmt part of common annotation.
  10260. * tree-flow-inline.h (tree_stmt): Return statement tree is part of.
  10261. * tree-flow.h (struct bb_ann_d): Add ephi_nodes.
  10262. * tree-optimize.c (optimize_tree): Activate SSAPRE again.
  10263. * tree-pretty-print.c (debug_generic_expr): New function.
  10264. (debug_generic_stmt): Ditto.
  10265. (dump_generic_node): Pretty print EUSE's, EREF's, and EPHI's.
  10266. * tree-ssa-pre.c: Rewrite almost entirely. Now performs more
  10267. strength reduction, EPHI minimization, and keeps SSA up to date.
  10268. * tree.c (tree_size): Handle EUSE, EPHI, EREF nodes.
  10269. (tree_node_structure): Ditto.
  10270. (ephi_node_elt_check_failed): New function.
  10271. * tree.def: Add EUSE_NODE, ELEFT_NODE, EKILL_NODE, EPHI_NODE,
  10272. EEXIT_NODE.
  10273. * tree.h (EREF_NODE_CHECK): New.
  10274. (EPHI_NODE_ELT_CHECK): New.
  10275. (struct tree_eref_common): New.
  10276. (struct tree_euse_node): New.
  10277. (struct tree_ephi_node): New.
  10278. (union tree_node): Add euse, eref, ephi members.
  10279. (enum tree_node_structure): Add TS_EPHI_NODE, TS_EUSE_NODE,
  10280. TS_EREF_NODE.
  10281. 2003-02-13 Daniel Berlin <dberlin@dberlin.org>
  10282. Andreas Jaeger <aj@suse.de>
  10283. * tree-flow.h: Add some garbage collector marks.
  10284. 2003-02-12 Jeff Law <law@redhat.com>
  10285. * Makefile.in (ssa.o): Depends on $(TREE_H) and tree-flow.h
  10286. * ssa.c: Include tree.h and tree-flow.h.
  10287. (compute_dominance_frontiers_1): Use the sparse bitmap
  10288. of dominator children from the basic block's annotation
  10289. if it's available. Otherwise build the sparse bitmap
  10290. using the result of get_dominated_by.
  10291. * tree-ssa.c (rewrite_into_ssa): Reorder things slightly so
  10292. that we can use the cached dominator children computed
  10293. by mark_def_sites in compute_dominance_frontiers.
  10294. 2003-02-12 Andreas Jaeger <aj@suse.de>
  10295. * tree-dfa.c (dump_alias_info): Cast variable of size_t properly.
  10296. 2003-02-12 Daniel Berlin <dberlin@dberlin.org>
  10297. * tree-dfa.c (find_may_aliases_for): Remove
  10298. (compute_may_aliases): Always call compute_alias_sets.
  10299. 2003-02-10 Jeff Law <law@redhat.com>
  10300. * ssa.c (compute_dominance_frontiers_1): Use a sparse bitmap
  10301. for the frontiers.
  10302. (compute_dominance_frontiers): Corresponding changes.
  10303. (convert_to_ssa): Similarly. Convert the sparse bitmap to
  10304. a simple bitmap to avoid lots of collateral damage.
  10305. * ssa.h (compute_dominance_frontiers): Update prototype.
  10306. * tree-ssa.c (added, in_work): Kill, no longer needed.
  10307. (struct def_blocks_d): Add new bitmap (livein_blocks).
  10308. (rewrite_into_ssa): Make dominance frontiers be a sparse
  10309. bitmap instead of a simple bitmap. Rename the "nonlocals"
  10310. simple bitmap to "globals". Pass it into mark_def_sites.
  10311. (compute_global_livein): New function.
  10312. (mark_def_sites): Also keep track of variables which are
  10313. used before they are set. Allow caller to allocate and
  10314. pass in a simple bitmap for global variables. Process
  10315. items defined in the statement last.
  10316. (set_def_block): Also allocate bitmap for globals.
  10317. (set_livein_block): New function.
  10318. (def_blocks_free): Free def_blocks correctly. Also free
  10319. livein_blocks.
  10320. (debug_def_blocks_r): Also dump the livein_blocks.
  10321. (insert_phi_nodes): Simplify now that we don't need the
  10322. added and in_work varrays. Accept DFS as a sparse bitmap
  10323. instead of a simple bitmap.
  10324. (insert_phi_nodes_for): Rework significantly. Pre-compute all
  10325. the insertion points for semi-pruned form. While computing those
  10326. insertion points keep track of how many phi vector entries
  10327. would be needed at those insertion points. When the number of
  10328. entries gets large (32), compute global life information and
  10329. use that to further pruned the number of PHI insertion points
  10330. necessary.
  10331. 2003-02-09 Diego Novillo <dnovillo@redhat.com>
  10332. * tree-dfa.c (find_vars_r): Assume that the RHS of an INDIRECT_REF,
  10333. that is also an SSA variable, is a VAR_DECL.
  10334. (get_virtual_var): Handle INDIRECT_REF nodes that are not valid SSA
  10335. variables.
  10336. * tree-ssa-dce.c (stmt_useful_p): Revert kludge in previous commit.
  10337. VA_ARG_EXPR nodes are not inherently live.
  10338. * tree-ssa.c (mark_def_sites): Don't process the LHS of assignments
  10339. twice.
  10340. The operand of a virtual definition constitutes a use of the
  10341. variable which should be considered a non-local if it had not been
  10342. killed inside the block.
  10343. * tree.h (SSA_VAR_P): Only return true for INDIRECT_REFs if their
  10344. operand is a _DECL node.
  10345. 2003-02-09 Diego Novillo <dnovillo@redhat.com>
  10346. * config/rs6000/t-rs6000 (simplify-rtx.o): Compile with -Wno-error.
  10347. 2003-02-08 Diego Novillo <dnovillo@redhat.com>
  10348. * toplev.c (parse_options_and_default_flags): Enable SSA DCE by
  10349. default.
  10350. * tree-dfa.c (get_expr_operands): Recurse into LHS of an ARRAY_REF
  10351. when it's not a regular variable. Always recurse into the RHS.
  10352. (add_stmt_operand): Set may_point_to_global_mem for pointers that
  10353. are assigned expressions that may reference global memory. Also
  10354. set its dereference variable to be an alias of global memory.
  10355. (dump_variable): Show may_point_to_global_mem flag.
  10356. (compute_alias_sets): Also dump all referenced variables when
  10357. dumping alias information.
  10358. (add_may_alias): Check for global memory aliasing.
  10359. (may_access_global_mem_p): Rename from may_access_global_mem.
  10360. Return true if the expression is a variable that may point to or
  10361. alias global memory.
  10362. (add_referenced_var): Pointer arguments and global pointers may
  10363. point to global memory.
  10364. (set_may_alias_global_mem): Move ...
  10365. * tree-flow-inline.h (set_may_alias_global_mem): ... here.
  10366. (set_may_point_to_global_mem): New function.
  10367. (may_point_to_global_mem_p): New function.
  10368. * tree-ssa-dce.c (stmt_useful_p): VA_ARG_EXPRs are inherently live.
  10369. * tree-ssa.c (rewrite_into_ssa): Don't call dump_referenced_vars.
  10370. 2003-02-06 Diego Novillo <dnovillo@redhat.com>
  10371. * tree-dfa.c (struct alias_tags, alias_tags, num_alias_tags):
  10372. Remove. Update all users.
  10373. (struct alias_set_d): New.
  10374. (alias_sets): New file local variable.
  10375. (compute_alias_sets): New function.
  10376. (compute_may_aliases): Call it when not doing points-to analysis.
  10377. (register_alias_set): New function.
  10378. (find_alias_for): New function.
  10379. (may_alias_p): Declare static.
  10380. Don't assume that VAR may not be aliased if it's a non-addressable
  10381. _DECL.
  10382. If VAR and PTR are aggregate types, check if they can have a field
  10383. that points to the other one.
  10384. (find_may_aliases_for): Move handling of global memory aliasing ...
  10385. (add_may_alias): ... here.
  10386. Also accept the base symbols for the variable and its alias.
  10387. (register_new_alias): Remove. Update all users.
  10388. (find_alias_tag): Remove. Update all users.
  10389. (find_vars_r): Update VAR after re-writing *TP when sharing
  10390. INDIRECT_REF nodes.
  10391. * tree-flow.h (may_alias_p): Remove declaration.
  10392. * tree-ssa.c (rewrite_into_ssa): Include referenced variables in
  10393. default debug dumps.
  10394. Support for VLAs.
  10395. * tree-dfa.c (find_vla_decls): New function.
  10396. (compute_may_aliases): Call it.
  10397. (find_vla_decls_r): New function.
  10398. (dump_variable): Show whether the variable is used in a VLA
  10399. declaration.
  10400. * tree-flow-inline.h (is_vla_decl): New function.
  10401. (set_vla_decl): New function.
  10402. * tree-flow.h (struct var_ann_d): Add bitfield 'is_vla_decl'.
  10403. * tree-ssa-dce.c (need_to_preserve_store): Return true if SYM is
  10404. used inside a VLA declaration.
  10405. 2003-02-05 Andrew MacLeod <amacleod@redhat.com>
  10406. * Makefile.in : Include new file tree-iterator.h in tree-simple.h
  10407. * gimplify.c (simplify_cleanup_point_expr): Use tsi_ rather than gsi_.
  10408. * tree-cfg.c (make_blocks, remove_bb): Use tsi_ not gsi_ routines.
  10409. (bsi_remove): Renamed from gsi_remove, use bsi_ routines.
  10410. (successor_block, first_exec_stmt): Use tsi_ not gsi_ routines.
  10411. (first_stmt, last_stmt, last_stmt_ptr): Use bsi_ not gsi_ routines.
  10412. (bsi_init): Split out from bsi_start.
  10413. (bsi_start): Renamed from gsi_start_bb, use bsi_ routines.
  10414. (bsi_next_in_bb): Moved from tree-flow-inline.h and renamed from
  10415. gsi_step_in_bb. Also verify BB of new stmt.
  10416. * tree-dfa.c (compute_immediate_uses, dump_immediate_uses,
  10417. collect_dfa_stats, compute_may_aliases): Use block_stmt_iterator.
  10418. * tree-flow-inline.h (gsi_step_in_bb): Moved to tree-cfg.c
  10419. (bsi_end_p): Renamed from gsi_end_bb_p.
  10420. (bsi_next): renamed from gsi_step_bb
  10421. (bsi_prev): New function.
  10422. (bsi_stmt_ptr): Block version of gsi_stmt_ptr.
  10423. (bsi_stmt): Block version of gsi_stmt.
  10424. (bsi_container): Block version of gsi_container.
  10425. * tree-flow.h (block_stmt_iterator): New iterator type.
  10426. * tree-iterator.h: New include file for tree_iterator.
  10427. * tree-simple.h : Include tree-iterator.h
  10428. (gimple_stmt_iterator, gsi_start, gsi_end_p, gsi_stmt_ptr,
  10429. gsi_stmt, gsi_container): Move to tree-iterator.h and rename to tsi_.
  10430. (gsi_step): Move to tree-iterator.h and renamed to tsi_next.
  10431. * tree-ssa-ccp.c (simulate_block, substitute_and_fold): Use block
  10432. iterators instead of gimple_stmt_iterator.
  10433. * tree-ssa-dce.c (mark_control_parent_necessary, find_useful_stmts,
  10434. remove_dead_stmts, remove_dead_stmt): Use block_stmt_iterator.
  10435. * tree-ssa.c (mark_def_sites, rewrite_out_of_ssa, rewrite_stmts): Use
  10436. block_stmt_iterator.
  10437. 2003-02-04 Daniel Berlin <dberlin@dberlin.org>
  10438. * tree-alias-common.c (get_alias_var_decl): If it's a global var,
  10439. make sure it doesn't get added to local_alias_vars.
  10440. (get_name): Return the right name for FUNCTION_DECL's.
  10441. 2003-02-04 Diego Novillo <dnovillo@redhat.com>
  10442. * tree-dfa.c (add_stmt_operand): Do not add a VUSE for a pointer
  10443. when clobbering its associated INDIRECT_REF variable.
  10444. 2003-02-04 Diego Novillo <dnovillo@redhat.com>
  10445. * config/rs6000/t-rs6000 (jump.o, regmove.o, c-typeck.o, cfgrtl.o,
  10446. combine.o, fold-const.o, ifcvt.o, reload1.o, rtlanal.o,
  10447. cp/decl2.o, cp/pt.o, f/where.o, java/expr.o, objc/objc-act.o,
  10448. rs6000.o, insn-emit.o): Compile with -Wno-error.
  10449. 2003-02-03 Diego Novillo <dnovillo@redhat.com>
  10450. Jeff Law <law@redhat.com>
  10451. * tree-cfg.c (make_blocks): Don't always start a new block with
  10452. COND_EXPR and SWITCH_EXPR statements.
  10453. Call stmt_ends_bb_p to determine if the current statement should be
  10454. the last in the block.
  10455. (make_cond_expr_blocks): Second argument is now the entry block
  10456. to the conditional.
  10457. (make_switch_expr_blocks): Second argument is now the entry block
  10458. to the switch.
  10459. (make_edges, make_ctrl_stmt_edges, make_loop_expr_edges,
  10460. cleanup_control_flow, cleanup_cond_expr_graph,
  10461. cleanup_switch_expr_graph, disconnect_unreachable_case_labels,
  10462. find_taken_edge, successor_block, latch_block, is_latch_block,
  10463. switch_parent): Work with the last statement of the block, not the
  10464. first.
  10465. (is_ctrl_altering_stmt): Pre-compute the code of the statement.
  10466. (stmt_starts_bb_p): Declare file local.
  10467. Don't call is_ctrl_stmt. Check if T is a LOOP_EXPR instead.
  10468. (stmt_ends_bb_p): New function.
  10469. * tree-flow.h (stmt_starts_bb_p): Remove declaration.
  10470. 2003-02-03 Diego Novillo <dnovillo@redhat.com>
  10471. * tree-dfa.c (find_vars_r): Share INDIRECT_REF nodes whose operand
  10472. is a VAR_DECL.
  10473. (add_referenced_var): Add additional argument 'sym'. Update all users.
  10474. Don't call get_base_symbol.
  10475. (add_indirect_ref_var): Rename argument 'var' to 'ptr'.
  10476. (htab_hash_var): Remove. Update all users to use htab_hash_pointer.
  10477. (htab_var_eq): Remove. Update all users to use htab_eq_pointer.
  10478. * tree-flow-inline.h (var_ann): Don't retrieve the annotation of
  10479. the base pointer for INDIRECT_REF variables.
  10480. (is_aliased): Remove. Update all users.
  10481. (is_dereferenced): Remove. Update all users.
  10482. (same_var_p): Remove. Update all users to use pointer equality.
  10483. * tree-simple.c (get_base_symbol): Convert tail recursion into
  10484. iteration.
  10485. * tree-ssa.c (rewrite_out_of_ssa): Add FIXME note about overlapping
  10486. live ranges for different versions of the same variable.
  10487. 2003-02-03 Jeff Law <law@redhat.com>
  10488. * tree-dfa.c (add_referenced_var): Annotate each item in the
  10489. REFERENCED_VARS varray with a unique id.
  10490. * tree-flow.h (struct var_ann_d): Add new uid field.
  10491. * tree-ssa.c (mark_def_sites): Compute the set of variables
  10492. live across basic blocks and return them in an sbitmap.
  10493. (insert_phi_nodes): Use the set of nonlocal variables computed
  10494. by mark_def_sites to reduce the number of PHI nodes inserted.
  10495. (rewrite_into_ssa): Updated to deal with changes in
  10496. insert_phi_nodes and mark_def_sites. Free the sbitmap returned
  10497. by mark_def_sites.
  10498. 2003-02-03 Diego Novillo <dnovillo@redhat.com>
  10499. * c-common.h (GOTO_DESTINATION): Remove. Fix botched
  10500. merge.
  10501. 2003-02-03 Diego Novillo <dnovillo@redhat.com>
  10502. Fix warnings to allow bootstrapping with -Werror.
  10503. * Makefile.in (c-semantics.o-warn): Add -Wno-error.
  10504. (emit-rtl.o-warn): Likewise.
  10505. (profile.o-warn): Likewise.
  10506. (tree.o-warn): Likewise.
  10507. (OBJS): Remove simple-break-elim.o and simple-goto-elim.o.
  10508. * c-pretty-print.c (print_function_decl): Remove unused function.
  10509. * bitmap.c (bitmap_last_set_bit): Initialize variable 'word'.
  10510. * c-typeck.c (build_binary_op): Initialize variable 'type'.
  10511. * combine.c (combine_simplify_rtx): Initialize variable 'reversed'.
  10512. (make_compound_operation): Initialize variable 'i'.
  10513. * dwarf2out.c (dwarf2out_finish): Initialize variable 'context'.
  10514. * expr.c (store_constructor): Initialize variables 'lo', 'hi',
  10515. 'startb' and 'endb'.
  10516. (expand_expr): Initialize variable 'op0'.
  10517. * fold-const.c (fold): Initialize variable 'tem'.
  10518. * profile.c (branch_prob): Initialize variable 'prev_file_name'.
  10519. * reload.c (find_equiv_reg): Initialize variables 'valtry and
  10520. 'valueno'.
  10521. * rtlanal.c (get_jump_table_offset): Initialize variable 'set'.
  10522. * ssa-ccp.c (ssa_const_prop): Fix sign mismatch warning.
  10523. * varasm.c (output_constant_def): Initialize variable 'defstr'.
  10524. * gimplify.c (simplify_expr): Initialize variables
  10525. 'saved_input_filename' and 'saved_lineno'.
  10526. (simplify_compound_lval): Initialize variable 'code'.
  10527. * tree-alias-ander.c (pta_bottom): De-ansify.
  10528. (andersen_cleanup): Remove unused variables.
  10529. (andersen_heap_assign): Mark argument lhs ATTRIBUTE_UNUSED.
  10530. (pta_bottom): Remove unused function.
  10531. (pta_get_ptsize): Remove unused function.
  10532. 2003-02-02 Diego Novillo <dnovillo@redhat.com>
  10533. * tree-dfa.c (get_expr_operands): Add a VUSE for the dereference of
  10534. every pointer passed in a function call.
  10535. Move code to add an operand for the base pointer of an
  10536. INDIRECT_REF ...
  10537. (add_stmt_operand): ... here.
  10538. Add a VUSE for the base pointer of every INDIRECT_REF variable.
  10539. (find_may_aliases_for): Fix starting index for the loop that scans
  10540. INDIRECT_REFs for aliasing.
  10541. Factor code that marks two variables aliased into
  10542. register_new_alias.
  10543. (register_new_alias): New function.
  10544. (may_alias_p): Handle aliasing of structure fields.
  10545. (add_may_alias): Fix documentation.
  10546. (find_vars_r): Factor code that adds a new referenced variable into
  10547. add_referenced_var.
  10548. (add_referenced_var): New function.
  10549. (add_indirect_ref_var): New function.
  10550. (get_virtual_var): Handle variables wrapped in SSA_NAMEs.
  10551. (set_may_alias_global_mem): Move from ...
  10552. * tree-flow-inline.h: ... here.
  10553. * tree-ssa-dce.c (need_to_preserve_store): CALL_EXPRs are
  10554. implicitly live. VA_ARG_EXPRs are not.
  10555. (stmt_useful_p):
  10556. * tree.h (SSA_NAME_VAR): Rename from SSA_NAME_DECL. Update all
  10557. users.
  10558. (struct tree_ssa_name): Rename field 'decl' to 'var'. Update all
  10559. users.
  10560. (SSA_DECL_P): Accept only VAR_DECLs and PARM_DECLs possibly wrapped
  10561. inside an SSA_NAME node.
  10562. (SSA_VAR_P): Also accept SSA_NAME nodes.
  10563. 2003-02-01 Daniel Berlin <dberlin@dberlin.org>
  10564. * Makefile.in (tree-ssa-pre2.o): Remove accidental addition.
  10565. 2003-01-31 Diego Novillo <dnovillo@redhat.com>
  10566. * tree-cfg.c (find_taken_edge_cond_expr): New function.
  10567. (find_taken_edge_switch_expr): New function.
  10568. (value_matches_some_label): New function.
  10569. (find_taken_edge): Re-structure to use the three new functions.
  10570. 2003-01-30 Jason Merrill <jason@redhat.com>
  10571. * gimplify.c (simplify_function_tree): Set TREE_SIDE_EFFECTS on
  10572. the BIND_EXPR wrapper.
  10573. 2003-01-30 Diego Novillo <dnovillo@redhat.com>
  10574. * tree-dfa.c (call_may_clobber): New function.
  10575. (get_expr_operands): Call it.
  10576. (find_vars_r): Call it.
  10577. 2003-01-30 Jeff Law <law@redhat.com>
  10578. * tree-dfa.c (struct alias_tags): New. Collector for key information
  10579. regarding alias tags.
  10580. (indirect_refs_base, indirect_refs_alias_set): New varrays.
  10581. (addressable_vars_base, addressable_vars_alias_set): Likewise.
  10582. (compute_may_aliases): Initialize and finalize the new varrays.
  10583. Update allocation of alias tags information.
  10584. (find_may_aliases_for): Extract base symbols and alias set
  10585. information for V1 and V2 from the virtual arrays and store
  10586. them into local variables. Pass them as necessary to
  10587. may_alias_p, may_access_global_mem, find_alias_tag. Add base
  10588. symbol and alias set when creating a new alias tag.
  10589. (find_vars_r): Fill in new varrays as needed.
  10590. (may_alias_p): Add new arguments for base and alias set of the
  10591. two origianl incoming arguments. No longer call get_base_symbol
  10592. or get_alias_set.
  10593. (find_alias_tag, may_access_global_mem): Similarly.
  10594. (add_stmt_operand): Update to pass additional argument to
  10595. may_access_global_mem.
  10596. (dump_alias_info): Update to deal with new alias tag structure.
  10597. * tree-flow.h (may_alias_p): Update prototype with new arguments.
  10598. * tree-ssa-pre.c (process_left_occs_and_kills): Update to pass
  10599. new arguments to may_alias_p.
  10600. 2003-01-30 Daniel Berlin <dberlin@dberlin.org>
  10601. Remove all traces of steensgaard's algorithm.
  10602. * tree-alias-steen.c: Removed.
  10603. * tree-alias-steen.h: Ditto.
  10604. * tree-alias-ecr.c: Ditto.
  10605. * tree-alias-ecr.h: Ditto.
  10606. * disjoint-set.c: Ditto.
  10607. * disjoint-set.h: Ditto.
  10608. * Makefile.in: Remove removed files.
  10609. * c-config-lang.in: Ditto.
  10610. * gengtype.c: Ditto.
  10611. * tree-alias-common.c: Don't use steen_alias_ops anymore.
  10612. * toplev.c: Remove help text and steen option.
  10613. * tree-alias-common.h: Remove PTA_STEEN.
  10614. * tree-alias-type.c: Remove all steensgaard related types and
  10615. functions.
  10616. * tree-alias-type.h: Ditto.
  10617. 2003-01-30 Diego Novillo <dnovillo@redhat.com>
  10618. * tree-cfg.c (struct cfg_stats_d): New.
  10619. (cfg_stats): New file local.
  10620. (build_tree_cfg): Start TV_TREE_CFG timer before allocating memory.
  10621. Initialize cfg_stats.
  10622. (make_blocks): Count coalesced label blocks.
  10623. (dump_tree_cfg): Call dump_cfg_stats if TDF_STATS is enabled.
  10624. (dump_cfg_stats): New.
  10625. (debug_cfg_stats): New.
  10626. * tree-dfa.c (SCALE, LABEL, PERCENT): Move ...
  10627. * tree-flow.h: ... here
  10628. 2003-01-29 Diego Novillo <dnovillo@redhat.com>
  10629. * tree-cfg.c (make_blocks): Do not start a new block if the
  10630. previous statement and the current statement are labels of the same
  10631. kind.
  10632. 2003-01-29 Diego Novillo <dnovillo@redhat.com>
  10633. * tree-cfg.c (parent_array): Make file local.
  10634. (label_to_block_map): New file local variable.
  10635. (build_tree_cfg): Initialize label_to_block_map.
  10636. (make_edges): Don't pre-scan all the blocks looking for blocks with
  10637. labels.
  10638. (make_exit_edges): Remove argument label_to_block_map. Update all
  10639. callers.
  10640. (make_goto_expr_edges): Likewise.
  10641. (dump_tree_bb): Check that the block has a valid annotation.
  10642. (set_bb_for_stmt): If the statement is a label, add the label to
  10643. the label_to_block_map.
  10644. * tree-pretty-print.c (dump_vops): Check that the block has a valid
  10645. annotation.
  10646. 2003-01-29 Jeff Law <law@redhat.com>
  10647. * tree-dfa.c (find_may_aliases_for): Just accept the index of
  10648. the current indirect_ref. Caller updated.
  10649. (num_indirect_refs, num_addressable_vars): New variables.
  10650. (indirect_refs, addressable_vars): New varrays.
  10651. (dump_dfa_status): Dump info on the indirect refs and
  10652. addressable vars.
  10653. (dump_alias_info): Similarly.
  10654. (compute_may_aliases): Initialize and finalize the new virtual
  10655. arrays and hash tables for indirect refs and addressable vars.
  10656. Include setup/teardown in the cost for alias analysis.
  10657. (find_may_aliases_for): Split main loop into two. The first
  10658. walks over the indirect refs and takes advantage of the
  10659. symmetric properties of the aliasing relationship to avoid
  10660. useless work. The second loop iterates over the addressable
  10661. variables.
  10662. (find_vars_r): Rework to build all three arrays we need.
  10663. 2003-01-29 Andreas Jaeger <aj@suse.de>
  10664. * tree-alias-common.c (find_func_aliases): Remove unused variable.
  10665. (display_points_to_set_helper): #if 0 function to avoid warning
  10666. about unused function.
  10667. * tree-alias-ecr.c (ECR_new): Remove ISO C style function
  10668. definition.
  10669. * disjoint-set.c (disjoint_set_new): Likewise.
  10670. 2003-01-29 Frank Ch. Eigler <fche@redhat.com>
  10671. * tree-mudflap.c (mx_xfn_indirect_ref): Use a stack of flags for
  10672. tracking pointer dereference reads vs writes.
  10673. (mf_build_check_statement_for): Pass access-type value to __mf_check.
  10674. * c-mudflap.c (mflang_register_call): Adapt to mf-runtime.h API change.
  10675. 2003-01-29 Diego Novillo <dnovillo@redhat.com>
  10676. * Makefile.in (ssa.o): Add dependency on $(TIMEVAR_H).
  10677. * timevar.def (TV_DOM_FRONTIERS): Define.
  10678. * ssa.c (compute_dominance_frontiers): Use.
  10679. 2003-01-29 Diego Novillo <dnovillo@redhat.com>
  10680. * tree-ssa-dce.c (remove_dead_stmt): Fix uninitialized use
  10681. warning.
  10682. 2003-01-28 Diego Novillo <dnovillo@redhat.com>
  10683. * timevar.def (TV_TREE_SSA_REWRITE_BLOCKS): Adjust legend.
  10684. * tree-ssa.c (rewrite_into_ssa): Use TV_TREE_SSA_REWRITE_BLOCKS.
  10685. (mark_def_sites): Add comment.
  10686. 2003-01-28 Jeff Law <law@redhat.com>
  10687. * ssa.c (compute_dominance_frontiers_1): Use get_dominated_by
  10688. to avoid useless walks over all the basic blocks. Use cache
  10689. of immediate dominators to avoid silly calls to get_immediate_dominator.
  10690. Do not clear elements of the frontiers bitmap.
  10691. (compute_dominance_frontiers): Compute cache of immediate
  10692. dominators and pass it to compute_dominance_frontiers_1. Clear
  10693. the entire vector of frontiers bitmaps.
  10694. * timevar.def (TV_TREE_SSA_REWRITE_BLOCKS): Renamed from
  10695. TV_TREE_BUILD_SSA.
  10696. (TV_TREE_SSA_OTHER): New timevar.
  10697. * tree-ssa.c (rewrite_into_ssa): Updated. Use new TV_TREE_SSA_OTHER
  10698. timevar.
  10699. * tree.h (LABEL_DECL_INDEX): Define for use by CFG builder.
  10700. * tree-cfg.c (make_exit_edges): Accept and pass though label to
  10701. block mapping array.
  10702. (make_goto_expr_edges): For simple gotos, lookup the destination
  10703. in the label to block mapping array. Zap old slow code to
  10704. handle simple gotos.
  10705. (make_edges): Build the label to block mapping array.
  10706. * tree.h (PHI_NODE_ELT_CHECK): Provide version when ENABLE_CHECKING
  10707. is not defined.
  10708. 2003-01-28 Diego Novillo <dnovillo@redhat.com>
  10709. * tree-flow-inline.h (parent_block, set_parent_block, phi_nodes):
  10710. Assume that blocks always have valid annotations.
  10711. (add_dom_child): New function.
  10712. (dominator_children): New function.
  10713. * tree-flow.h (struct bb_ann_d): Add field 'dom_children'.
  10714. * tree-ssa.c (mark_def_sites): Add parameter 'idom'.
  10715. Add each block BB to the set of dominator children of BB's
  10716. immediate dominator.
  10717. (rewrite_block): Remove 'idom' parameter.
  10718. Recurse into blocks set in the dominator children bitmap.
  10719. 2003-01-28 Diego Novillo <dnovillo@redhat.com>
  10720. * flags.h (flag_disable_tree_ssa): New flag.
  10721. * c-decl.c (c_expand_body): Use it.
  10722. * toplev.c: Declare it.
  10723. (f_options): Add help text for -fdisable-tree-ssa.
  10724. * doc/invoke.texi: Add documentation for -fdisable-tree-ssa.
  10725. 2003-01-28 Diego Novillo <dnovillo@redhat.com>
  10726. * Makefile.in (TREE_FLOW_H): Add dependency on $(HASHTAB_H)
  10727. (OBJS): Temporarily remove tree-ssa-pre.o.
  10728. (tree-ssa.o, c-decl.o): Add dependency on $(TREE_DUMP_H).
  10729. * c-decl.c: Include tree-dump.h
  10730. * c-pretty-print.c (dump_c_node): Fix rendering of GOTO_STMTs to
  10731. computed locations.
  10732. (op_prio): Don't abort on unknown operators.
  10733. * c-simplify.c (mostly_copy_tree_r): Don't copy statement
  10734. annotations.
  10735. * gimplify.c (simplify_addr_expr): Mark the RHS of the simplified
  10736. ADDR_EXPR addressable.
  10737. (mostly_copy_tree_r): Don't copy statement annotations.
  10738. * old-tree-inline.c (walk_tree): Handle SSA_NAME nodes.
  10739. * timevar.def (TV_TREE_RDEFS): Remove.
  10740. (TV_TREE_BUILD_SSA): Define.
  10741. (TV_TREE_DFA): Define.
  10742. * tree-cfg.c: Update copyright notices.
  10743. Remove doxygen markers everywhere.
  10744. (remove_unreachable_block): New local function
  10745. (remove_unreachable_blocks): Call it.
  10746. (remove_bb): Rename from remove_tree_bb. Update all callers.
  10747. (validate_loops): Remove unused function.
  10748. (block_invalidates_loop): Remove unused function.
  10749. (remove_stmt): Invalidate the defining statement of all the
  10750. definitions made by the statement.
  10751. Remove the annotation before replacing the statement with
  10752. empty_stmt_node.
  10753. * tree-dfa.c: Update copyright notices.
  10754. Remove doxygen markers everywhere.
  10755. (struct clobber_data_d): Remove existing fields. Add fields 'stmt'
  10756. and 'prev_vops'. Update all users.
  10757. (alias_tags): Rename from alias_leaders.
  10758. (num_alias_tags): Rename from num_alias_leaders.
  10759. (struct dfa_stats_d): Declare.
  10760. (struct dfa_counts_d): Remove. Update all users.
  10761. (TRM_*): Remove. Update all users.
  10762. (find_tree_refs): Remove. Update all users.
  10763. (get_stmt_operands): Rename from find_refs_in_stmt. Update all users.
  10764. (get_expr_operands): Rename from find_refs_in_expr. Update all users.
  10765. (add_stmt_operand): New function.
  10766. (set_def): New function.
  10767. (add_use): New function.
  10768. (add_vdef): New function.
  10769. (add_vuse): New function.
  10770. (create_phi_node): New function.
  10771. (copy_stmt): New function.
  10772. (compute_immediate_uses): New function.
  10773. (compute_immediate_uses_for): New function.
  10774. (compute_reached_uses): New function.
  10775. (compute_reaching_defs): New function.
  10776. (add_immediate_use): New function.
  10777. (create_var_ann): New function.
  10778. (create_stmt_ann): New function.
  10779. (dump_immediate_uses): New function.
  10780. (debug_immediate_uses): New function.
  10781. (dump_immediate_uses_for): New function.
  10782. (debug_immediate_uses_for): New function.
  10783. (create_ref_list, empty_ref_list, add_ref_to_list_begin,
  10784. add_ref_to_list_end, add_list_to_list_begin, add_list_to_list_end,
  10785. find_list_node, rli_start, rli_start_last, rli_start_at,
  10786. rli_delete, add_ref_to_list_after, tree_ref_size, create_ref,
  10787. add_ephi_arg, add_referenced_var, replace_ref_with,
  10788. try_replace_ref_with, replace_ref_r, replace_ref_stmt_with,
  10789. remove_ref, remove_def, reset_def_def_links, replace_phi_arg_with,
  10790. create_tree_ann, function_may_recurse_p, dump_ref, debug_ref,
  10791. dump_ref_list, dump_ref_array, debug_ref_list, debug_ref_array,
  10792. dump_phi_args, dump_if_different, count_tree_refs, ref_type_name,
  10793. ref_defines, is_killing_def, tree_ref_structure, output_ref):
  10794. Remove. Update all users.
  10795. (dump_referenced_vars): Remove parameter 'details'. Update all
  10796. users.
  10797. (dump_variable): Don't abort if the variable is nil. Display all
  10798. the aliases for the variable.
  10799. (dump_dfa_stats): Handle new counters.
  10800. (collect_dfa_stats): Likewise.
  10801. (collect_dfa_stats_r): Likewise.
  10802. (find_vars_r): New function.
  10803. (compute_may_aliases): Call it via walk_tree before computing aliases.
  10804. Only use alias tags if -ftree-points-to is not given.
  10805. Call add_may_alias.
  10806. (find_may_aliases_for): Only use alias tags if -ftree-points-to is
  10807. not given.
  10808. (add_may_alias): New function.
  10809. (find_alias_tag): Rename from find_alias_leader.
  10810. (dump_alias_info): New function.
  10811. (debug_alias_info): New function.
  10812. (htab_hash_var): New function.
  10813. (htab_var_eq): New function.
  10814. (get_virtual_var): New function.
  10815. * tree-dump.c (struct dump_option_value_info): Rename -block to
  10816. -blocks. Add new option -vops.
  10817. (dump_function): Don't display which pass enabled the dump.
  10818. * tree-flow-inline.h: Update copyright notices.
  10819. (var_ann): New function.
  10820. (stmt_ann): New function.
  10821. (ann_type): New function.
  10822. (bb_ann): Rename from bb_annotation.
  10823. (may_aliases): New function.
  10824. (set_may_alias_global_mem): New function.
  10825. (may_alias_global_mem_p): New function.
  10826. (set_indirect_ref): New function.
  10827. (indirect_ref): New function.
  10828. (is_dereferenced): New function.
  10829. (modify_stmt): New function.
  10830. (unmodify_stmt): New function.
  10831. (stmt_modified_p): New function.
  10832. (def_op): New function.
  10833. (use_ops): New function.
  10834. (vdef_ops): New function.
  10835. (vuse_ops): New function.
  10836. (immediate_uses): New function.
  10837. (reaching_defs): New function.
  10838. (phi_nodes): New function.
  10839. (same_var_p): New function.
  10840. (gsi_step_in_bb): Re-implement. Check if the iterator stepped out
  10841. of the block by calling bb_for_stmt.
  10842. (gsi_end_bb_p): Rename from gsi_end_bb. Update all users.
  10843. Call gsi_stmt to determine if the iterator has reached the end of
  10844. the block.
  10845. (ref_id, ref_type, ref_bb, ref_stmt, ref_var, imm_uses,
  10846. reached_uses, imm_reaching_def, set_imm_reaching_def,
  10847. set_phi_arg_def, phi_arg_def, set_phi_arg_edge, phi_arg_edge,
  10848. reaching_defs, phi_args, num_phi_args, phi_arg, set_phi_arg,
  10849. tree_annotation, tree_refs, add_tree_ref, remove_tree_ref,
  10850. alias_leader, set_alias_leader, set_tree_flag, clear_tree_flag,
  10851. reset_tree_flags, tree_flags, indirect_var, set_indirect_var,
  10852. bb_refs, remove_bb_ref, set_exprref_class, exprref_class,
  10853. set_exprref_inserted, exprref_inserted, set_exprref_save,
  10854. exprref_save, set_exprref_reload, exprref_reload,
  10855. set_exprref_processed, set_exprref_processed2, exprref_processed2i,
  10856. exprref_uses, set_exprref_uses, set_expruse_def, expruse_def,
  10857. set_expruse_phiop, expruse_phiop, set_expruse_phi, expruse_phi,
  10858. set_expruse_has_real_use, expruse_has_real_use,
  10859. set_exprphi_phi_args, exprphi_phi_args, num_ephi_args, ephi_arg,
  10860. set_ephi_arg, set_exprphi_downsafe, exprphi_downsafe,
  10861. set_exprphi_canbeavail, exprphi_canbeavail, set_exprphi_later,
  10862. exprphi_later, set_exprphi_extraneous, exprphi_extraneous,
  10863. exprphi_willbeavail, is_assignment_stmt, is_may_ref, is_may_def,
  10864. is_may_use, is_partial_ref, is_partial_use, is_volatile_ref,
  10865. is_volatile_def, is_volatile_use, is_clobbering_def,
  10866. is_relocating_def, is_addressof_use, is_pure_use, is_pure_def,
  10867. rli_after_end, rli_step, rli_step_rev, rli_ref, get_last_ref,
  10868. get_first_ref, ref_list_is_empty): Remove. Update all users.
  10869. * tree-flow.h: Update copyright notices.
  10870. Remove doxygen markers.
  10871. Include hashtab.h.
  10872. (enum tree_ann_type): New.
  10873. (struct tree_ann_common_d): New.
  10874. (struct var_ann_d): New.
  10875. (struct operands_d): New.
  10876. (struct voperands_d): New.
  10877. (operands_t): New type.
  10878. (voperands_t): New type.
  10879. (struct dataflow_d): New.
  10880. (dataflow_t): New type.
  10881. (struct stmt_ann_d): New.
  10882. (tree_ann): New type.
  10883. (var_ann_t): New type.
  10884. (stmt_ann_t): New type.
  10885. (bb_ann_t): Rename from bb_ann.
  10886. (enum tree_ref_type, TRM_*, struct ref_list_node, struct
  10887. ref_list_priv, ref_list, struct tree_ref_common, struct var_ref_d,
  10888. struct var_def_d, struct var_phi_d, struct var_use_d, struct
  10889. phi_node_arg_d, phi_node_arg, struct expr_ref_common, struct
  10890. expr_phi_d, struct expr_use_d, enum tree_ref_structure_enum, union
  10891. tree_ref_d, tree_ref, struct tree_ann_d, tree_ann, enum tree_flags,
  10892. struct dfa_counts_d, ref_list_iterator): Remove. Update all users.
  10893. (TDFA_USE_OPS): Define.
  10894. (TDFA_USE_VOPS): Define.
  10895. * tree-inline.c (walk_tree): Handle SSA_NAME nodes.
  10896. * tree-optimize.c: Update copyright notices.
  10897. Remove doxygen markers.
  10898. (optimize_function_tree): Temporarily disable call to
  10899. tree_perform_ssapre.
  10900. Remove #if0 code.
  10901. * tree-pretty-print.c (MASK_POINTER): Define.
  10902. (dump_vops): New function.
  10903. (dump_generic_node): Shorten made-up names for unnamed objects.
  10904. Hanlde PHI_NODE, VDEF_EXPR and SSA_NAME nodes.
  10905. Keep track of basic block transitions.
  10906. Call dump_vops if -vops dump option is given.
  10907. (op_prio): Don't abort if the operand is nil.
  10908. (dump_block_info): Don't keep track of basic block transitions.
  10909. * tree-simple.c: Update copyright notices.
  10910. (get_base_symbol): Call STRIP_NOPS.
  10911. Handle SSA_NAME nodes.
  10912. * tree-simple.h: Update copyright notices.
  10913. (gsi_end_p): Rename from gsi_end. Update all callers.
  10914. * tree-ssa-ccp.c: Update copyright notices.
  10915. Update code to use the new SSA infrastructure.
  10916. (const_values): New hash table to keep track of constants.
  10917. (struct value_map_d): New.
  10918. (cfg_edges): Rename from edges. Update all users.
  10919. (set_value): New function.
  10920. (get_value): New function.
  10921. (get_default_value): New function.
  10922. (value_map_hash): New function.
  10923. (value_map_eq): New function.
  10924. * tree-ssa-dce.c: Update copyright notice.
  10925. Update code to use new SSA infrastructure. Factor some code into
  10926. new functions.
  10927. (dom_info): Declare with file scope.
  10928. (struct stmt_stats): Add fields 'total_phis' and 'removed_phis'.
  10929. (needed_stmts): New hash table to keep track of needed statements.
  10930. (stmt_useful_p): New function.
  10931. (find_useful_stmts): Call it.
  10932. (remove_dead_stmt, remove_dead_phis): New functions.
  10933. (remove_dead_stmts): Call them.
  10934. (need_to_preserve_store): Preserve stores to volatile variables.
  10935. (tree_ssa_dce): Rename from tree_ssa_eliminate_dead_code. Update
  10936. all users.
  10937. * tree-ssa.c: Update copyright notice.
  10938. Change basic algorithm to rewrite the function into SSA form
  10939. instead of building factored use-def chains.
  10940. Include hashtab.h and tree-dump.h
  10941. (next_ssa_version): New global variable.
  10942. (def_blocks): New file local variable.
  10943. (struct def_blocks_d): New.
  10944. (currdefs): New file local variable.
  10945. (struct currdef_d): New.
  10946. (rewrite_into_ssa): Rename from build_tree_ssa. Update all users.
  10947. Call compute_may_aliases, mark_def_sites and rewrite_block.
  10948. (rewrite_block): Rename from search_fud_chains. Call
  10949. rewrite_stmts.
  10950. (mark_def_sites): New function.
  10951. (set_def_block): New function.
  10952. (rewrite_stmts): New function.
  10953. (rewrite_stmt): New function.
  10954. (rewrite_operand): New function.
  10955. (rewrite_out_of_ssa): New function.
  10956. (remove_phi_node): New function.
  10957. (register_new_def): New function.
  10958. (def_blocks_free): New function.
  10959. (def_blocks_hash): New function.
  10960. (def_blocks_eq): New function.
  10961. (currdef_hash): New function.
  10962. (currdef_eq): New function.
  10963. (debug_def_blocks): New function.
  10964. (debug_def_blocks_r): New function.
  10965. (build_fud_chains, compute_reaching_defs, follow_chain,
  10966. dump_reaching_defs, debug_reaching_defs, set_ssa_links): Remove.
  10967. (remove_phi_arg): Rename from tree_ssa_remove_phi_alternative.
  10968. Update all users.
  10969. (init_tree_ssa): Set next_ssa_version to 1.
  10970. Create hash tables def_blocks and currdefs.
  10971. (delete_tree_ssa): Accept a FUNCTION_DECL tree as argument. Update
  10972. all users.
  10973. (currdef_for): Add new parameter 'create_default'. If nonzero,
  10974. create a new SSA name if none is found for the variable.
  10975. (set_currdef_for): Search in the currdefs hash table.
  10976. * tree.c (tree_node_kind): Add new values phi_kind and
  10977. ssa_name_kind.
  10978. (tree_node_kind_names): Likewise.
  10979. (tree_size): Handle PHI_NODE and SSA_NAME nodes.
  10980. (make_node): Likewise.
  10981. (tree_node_structure): Likewise.
  10982. (phi_node_elt_check_failed): New function.
  10983. (make_phi_node): New function.
  10984. (make_ssa_name): New function.
  10985. (build_vdef_expr): New function.
  10986. * tree.def (SSA_NAME): New code.
  10987. (VDEF_EXPR): New code.
  10988. (PHI_NODE): New code.
  10989. * tree.h (union tree_ann_d): Forward declare.
  10990. (struct tree_common): Change type of field 'ann'.
  10991. (PHI_NODE_ELT_CHECK): Define.
  10992. (phi_node_elt_check_failed): Declare.
  10993. (VDEF_RESULT): Define.
  10994. (VDEF_OP): Define.
  10995. (SSA_NAME_DECL): Define.
  10996. (SSA_NAME_DEF_STMT): Define.
  10997. (SSA_NAME_VERSION): Define.
  10998. (struct tree_ssa_name): New.
  10999. (PHI_RESULT): Define.
  11000. (PHI_NUM_ARGS): Define.
  11001. (PHI_ARG_CAPACITY): Define.
  11002. (PHI_ARG_ELT): Define.
  11003. (PHI_ARG_EDGE): Define.
  11004. (PHI_ARG_DEF): Define.
  11005. (struct phi_arg_d): New.
  11006. (struct tree_phi_node): New.
  11007. (SSA_DECL_P): Define.
  11008. (SSA_VAR_P): Define.
  11009. (enum tree_node_structure_enum): Add values TS_SSA_NAME and
  11010. TS_PHI_NODE.
  11011. (union tree_node): Add fields 'ssa_name' and 'phi'.
  11012. (make_phi_node): Declare.
  11013. (make_ssa_name): Declare.
  11014. (build_vdef_expr): Declare.
  11015. (TDF_BLOCKS): Rename from TDF_BLOCK.
  11016. (TDF_VOPS): Define.
  11017. * doc/invoke.texi: Document new tree dump option -vops. Update
  11018. documentation for switch -blocks.
  11019. 2003-01-27 Jeff Law <law@redhat.com>
  11020. * gimplify.c (simplify_return_expr): Correctly handle return
  11021. expressions with side effects in functions returning void.
  11022. * tree-ssa-ccp.c (widen_bitfield): Do not try to widen anything
  11023. except constant integers.
  11024. 2003-01-26 Jeff Law <law@redhat.com>
  11025. * c-simplify.c (simplify_decl_stmt): Fix comment typo.
  11026. Use correct predicate when "simplifying" a static initializer.
  11027. 2003-01-26 Andreas Jaeger <aj@suse.de>
  11028. * Makefile.in (gt-dependence.h): New rule.
  11029. 2003-01-23 Jeff Law <law@redhat.com>
  11030. * c-simplify.c (simplify_decl_stmt): Arrange to examine initializers
  11031. for static variables.
  11032. * gimplify.c (simplify_constructor): Kill initial is_simple_constructor
  11033. check.
  11034. (simplify_modify_expr): Get the type from the destination rather than
  11035. the toplevel expression. Handle case where type is ARRAY_TYPE. Ignore
  11036. TREE_STATIC for the RHS.
  11037. 2003-01-24 Frank Ch. Eigler <fche@redhat.com>
  11038. * tree-mudflap.c (mf_varname_tree): Check for non-NULL DECL_NAME
  11039. before trying to cplus_demangle it.
  11040. 2003-01-23 Jeff Law <law@redhat.com>
  11041. * tree-cfg.c (make_exit_edges): Fix thinkos.
  11042. 2003-01-22 Jeff Law <law@redhat.com>
  11043. * tree-cfg.c (make_goto_expr_edges): Check the underlying
  11044. LABEL_DECL, not the LABEL_EXPR for FORCED_LABEL and NONLOCAL_LABEL.
  11045. * gimplify.c (simplify_expr, case GOTO_EXPR): Identify and mark
  11046. labels which are targets of nonlocal gotos and mark functions which
  11047. have labels which are targets of nonlocal gotos.
  11048. (simplify_expr, case LABEL_DECL): New case. Mark labels which
  11049. have their address taken.
  11050. * tree-cfg.c (is_nonlocal_label_block): Remove. All callers
  11051. updated.
  11052. (make_exit_edges, case GOTO_EXPR): Handle computed gotos sanely.
  11053. (make_exit_edges, case CALL_EXPR): Handle abnormal edges from
  11054. nonlocal gotos at call sites.
  11055. (make_exit_edges, case RETURN_EXPR): Likewise.
  11056. (make_exit_edges, case MODIFY_EXPR): New case to handle abnormal
  11057. edges from nonlocal gotos as call sites.
  11058. (make_goto_expr_edges): Handle computed gotos and nonlocal gotos.
  11059. (is_ctrl_altering_stmt): Handle abnormal edges in CALL_EXPRs
  11060. functions which receive nonlocal gotos. Similarly for CALL_EXPRs
  11061. which occur on the RHS of a MODIFY_EXPR.
  11062. * tree.h (FORCED_LABEL, NONLOCAL_LABEL): New defines.
  11063. (FUNCTION_RECEIVES_NONLOCAL_GOTO): Likewise.
  11064. 2003-01-22 Frank Ch. Eigler <fche@redhat.com>
  11065. * doc/invoke.texi: Provide some information about -fmudflap.
  11066. * tree-mudflap.c (mf_varname_tree): Conditionally invoke the C++
  11067. demangler in libiberty. Reduce function printing verbosity.
  11068. (mf_file_function_line_tree): Reduce function printing verbosity.
  11069. (mudflap_enqueue_decl): Use COMPLETE_TYPE_P to avoid trying to
  11070. register (get size of) void-typed objects.
  11071. 2003-01-21 Jose Renau <renau@uiuc.edu>
  11072. * tree-flow-inline.h (get_lineno): Return -1 for nodes without
  11073. locus information.
  11074. (get_filename): Return "???" for nodes without locus information.
  11075. 2003-01-21 Jeff Law <law@redhat.com>
  11076. * tree-cfg.c (cleanup_switch_expr_graph): Wrap declaration of
  11077. switch_expr with ENABLE_CHECKING block.
  11078. * c-simplify.c (is_last_stmt_of_scope): Wrap definition and
  11079. declaration inside and ENABLE_CHECKING block.
  11080. 2003-01-20 Frank Ch. Eigler <fche@redhat.com>
  11081. * tree-mudflap.c (mx_xfn_indirect_ref): Use new TREE_LOCUS field
  11082. as a predicate for finding TREE_FILENAME etc.
  11083. 2003-01-16 Daniel Berlin <dan@dberlin.org>
  11084. * Remove dead PRE code.
  11085. * tree-ssa-pre.c (tree_perform_ssapre): Collect left occurrences and
  11086. kills *after* finishing collecting all expressions.
  11087. 2003-01-15 Jeff Law <law@redhat.com>
  11088. * Death to WFL nodes.
  11089. * c-aux-info.c: Replace DECL_SOURCE_FILE and DECL_SOURCE_LINE with
  11090. TREE_FILENAME and TREE_LINENO respectively when retrieving file
  11091. and line information. Use TREE_LOCUS to copy existing information
  11092. from one node to another. Use annotate_with_file_line to add or
  11093. replace location information on a node. Remove support for
  11094. EXPR_WITH_FILE_LOCATION nodes. Remove STRIP_WFL statements.
  11095. * c-common.c, c-parse.in, c-pretty-print.c, dbxout.c: Likewise.
  11096. * diagnostic.c, dwarf2out.c, dwarfout.c: Likewise.
  11097. * except.c, integrate.c, stmt.c, tree-alias-common.c: Likewise.
  11098. * tree-cfg.c, tree-dfa.c, tree-dump.c, tree-flow-inline.h: Likewise.
  11099. * tree-mudflap.c, tree-pretty-print.c, tree-simple.c: Likewise.
  11100. * tree-ssa-ccp.c, tree-ssa-dce.c, tree-ssa-pre.c: Likewise.
  11101. * varasm.c, xcoffout.c: Likewise.
  11102. * config/alpha/alpha.c: Likewise.
  11103. * config/mips/mips.c: Likewise.
  11104. * c-decl.c: Likewise.
  11105. (duplicate_decls): Also copy TREE_LOCUS from olddecl to newdecl.
  11106. (finish_function): Save and restore the current filename and
  11107. linenumber around genericizing of the function tree.
  11108. * c-simplify.c (c_simplify_stmt): Use annotate_all_with_file_line
  11109. instead of wrap_all_with_wfl. Remove STRIP_WFL statements.
  11110. * expr.c (expand_expr): Emit line number notes for expressions
  11111. with attached file/line information. Remove EXPR_WITH_FILE_LOCATION
  11112. support.
  11113. * gimplify.c: Kill STRIP_WFL statements. Remove EXPR_WITH_FILE_LOCATION
  11114. support.
  11115. (simplify_expr_wfl): Kill.
  11116. (annotate_stmt_with_file_line): Renamed from wrap_with_wfl.
  11117. (annotate_all_with_file_line): Renamed from wrap_all_with_wfl.
  11118. (simplify_expr): Save and restore the current file/line around
  11119. simplification of the given expression. Add annotation to more
  11120. nodes created during simplification.
  11121. (simplify_self_mod_expr): Add file/line location to nodes we create.
  11122. (get_initialized_tmp_var): Similarly.
  11123. * old-tree-inline.c (expand_call_inline): Use annotate_with_file_line
  11124. to add file/line information to nodes instead of wrapping them
  11125. with EXPR_WITH_FILE_LOCATION nodes.
  11126. * print-tree.c: Use TREE_FILENAME and TREE_LINENO instead of
  11127. DECL_SOURCE_FILE and DECL_SOURCE_LINE respectively. Remove
  11128. support for EXPR_WITH_FILE_LOCATION nodes.
  11129. (print_node): Dump any file/line information that is attached to
  11130. the given node.
  11131. * tree-inline.c (walk_tree): Set lineno appropriately.
  11132. * tree-simple.h (annotate_all_with_file_line): Renamed from
  11133. wrap_all_with_wfl. Remove STRIP_WFL statements.
  11134. * tree.c (build_expr_wfl): Kill.
  11135. (make_node): Use annotate_with_file_line.
  11136. (annotate_with_file_line): New function.
  11137. * tree.def: Remove EXPR_WITH_FILE_LOCATION.
  11138. * tree.h (tree_common): Add locus field. Remove references to
  11139. EXPR_WITH_FILE_LOCATION.
  11140. (tree_decl): Remove locus field.
  11141. (STRIP_WFL, EXPR_WFL_*): Kill.
  11142. (DECL_SOURCE_LOCATION, DECL_SOURCE_FILE, DECL_SOURCE_LINE): Kill.
  11143. (TREE_LOCUS, TREE_FILENAME, TREE_LINENO): new.
  11144. (annotate_with_file_line): Renamed from build_expr_wfl.
  11145. * objc/objc-act.c: Use TREE_FILENAME and TREE_LINENO to
  11146. extract file/line information from tree nodes.
  11147. 2003-01-14 Frank Ch. Eigler <fche@redhat.com>
  11148. * tree-mudflap.c (mx_xfn_indirect_ref): Handle ARRAY_REF of
  11149. a COMPONENT_REF specially to avoid unnecessary checks.
  11150. 2003-01-13 Frank Ch. Eigler <fche@redhat.com>
  11151. Front-end generalization.
  11152. * Makefile.in (C_AND_OBJC_OBJS): Add c-mudflap.o and dependencies.
  11153. * tree-mudflap.c: Don't include "c-tree.h" any more.
  11154. (mf_init_extern_trees): Divert to mflang_lookup_decl().
  11155. (mf_enqueue_register_call, mf_flush_enqueued_calls): Move and rename
  11156. these functions.
  11157. * tree-mudflap.h: Declare new mflang_* routines.
  11158. * c-mudflap.c: New file with C front-end mflang_* routines.
  11159. * tree-nomudflap.c (*): Call internal_error instead of abort.
  11160. 2003-01-07 Steven Bosscher <s.bosscher@student.tudelft.nl>
  11161. * Makefile.in (check-g95): New test target.
  11162. (check-f95): Alias for check-g95.
  11163. 2003-01-07 Diego Novillo <dnovillo@redhat.com>
  11164. * tree-dump.c (dump_function_to_file): New function.
  11165. (dump_function): Call it.
  11166. Convert argument declaration to K&R format.
  11167. * tree-dump.h: Include splay-tree.h.
  11168. (dump_function_to_file): Declare.
  11169. * tree-optimize.c (optimize_function_tree): Remove unused variables
  11170. dump_file and dump_flags.
  11171. (dump_current_function): Remove. Update all users by calling
  11172. dump_function instead.
  11173. * tree.h (dump_current_function): Remove declaration.
  11174. * Makefile.in (TREE_DUMP_H): Define.
  11175. Update targets depending on tree-dump.h to depend on $(TREE_DUMP_H).
  11176. (tree-ssa-cp.o): Remove unused target.
  11177. (tree-cfg.o): Add dependency on $(TREE_DUMP_H).
  11178. (tree-optimize.o): Likewise.
  11179. (tree-ssa-dce.o): Likewise.
  11180. (tree-ssa-ccp.o): Likewise.
  11181. (tree-ssa-pre.o): Likewise.
  11182. 2003-01-02 Daniel Berlin <dberlin@dberlin.org>
  11183. * tree-ssa-pre.c (rename_2): Fix a false matching condition.
  11184. This is actually fallout from is_default_def change.
  11185. 2003-01-02 Jason Merrill <jason@redhat.com>
  11186. * c-simplify.c (c_genericize): Dump more info about the function.
  11187. Use dump_function.
  11188. * tree-dump.c (dump_function): Move from cp/optimize.c.
  11189. * tree-dump.h: Declare it.
  11190. * gimplify.c (mostly_copy_tree_r): Remove unnecessary cases.
  11191. (unshare_expr): New fn.
  11192. * tree-inline.c (mark_local_for_remap_r, unsave_r): New fns, adapted
  11193. from C++ versions.
  11194. (lhd_unsave_expr_now): Likewise.
  11195. * tree.c (unsave_expr_now): Remove.
  11196. (unsafe_for_reeval): Labels and BIND_EXPRs are only somewhat unsafe.
  11197. * gimplify.c (simplify_function_tree): Add an outer BIND_EXPR if
  11198. needed.
  11199. (voidify_wrapper_expr): Not static. Abort if we try to voidify an
  11200. expression with TREE_ADDRESSABLE type. Be clever with INDIRECT_REFs.
  11201. (foreach_stmt): Avoid redundant work.
  11202. (create_tmp_var): Abort if we try to create a temp of ADDRESSABLE type.
  11203. (simplify_expr): Simplify VTABLE_REF.
  11204. * c-simplify.c (simplify_decl_stmt): Ignore DECL_EXTERNAL decls.
  11205. (simplify_stmt_expr): Fix thinko.
  11206. (simplify_block): Don't ignore partial scopes.
  11207. (simplify_condition): New fn.
  11208. (simplify_c_loop, simplify_if_stmt, simplify_switch_stmt): Call it.
  11209. * expr.c (expand_expr) [BIND_EXPR]: Handle statics better.
  11210. * tree-inline.c (remap_decl): Remap all decls.
  11211. (declare_return_variable): Be clever with INDIRECT_REFs.
  11212. (expand_call_inline): If we have an explicit return slot, the inlined
  11213. body is void.
  11214. (walk_tree): Fix type handling.
  11215. (copy_tree_r): Don't walk into decls.
  11216. * tree-simple.c (is_simple_unary_expr): Handle VTABLE_REF.
  11217. (is_simple_id): Allow RESULT_DECL.
  11218. * tree-simple.h (gsi_stmt): Strip WFLs and NOPs.
  11219. * gimplify.c (simplify_cond_expr): Handle void arms. Add target parm.
  11220. (simplify_modify_expr): Pass it. Add special handling for COND_EXPR
  11221. and CONSTRUCTOR (from Daniel Berlin). Add want_value parm.
  11222. (simplify_expr): Pass new args. Loop sooner if language-specific
  11223. simplification happened.
  11224. (simplify_return_expr): Pass the whole MODIFY_EXPR to simplify_expr.
  11225. (simplify_target_expr): Simplify.
  11226. * tree.def (CATCH_EXPR, EH_FILTER_EXPR): New tree codes.
  11227. * except.c (expand_eh_handler): New fn.
  11228. (expand_eh_region_end_allowed): If no types are allowed, hand off to
  11229. expand_eh_region_end_must_not_throw.
  11230. * except.h: Declare expand_eh_handler.
  11231. * expr.c (expand_expr) [TRY_CATCH_EXPR]: Use it.
  11232. [CATCH_EXPR, EH_FILTER_EXPR]: New cases.
  11233. * gimplify.c (simplify_expr) [EXC_PTR_EXPR, CATCH_EXPR,
  11234. EH_FILTER_EXPR]: New cases.
  11235. (gimple_build_eh_filter): New fn.
  11236. (maybe_protect_cleanup): New fn.
  11237. (gimple_push_cleanup): Call it.
  11238. (simplify_cleanup_point_expr): Fix thinko.
  11239. * c-simplify.c (simplify_cleanup): Call it.
  11240. * tree-simple.h: Declare it.
  11241. * Makefile.in (gimplify.o): Depend on except.h.
  11242. * tree.h (CATCH_TYPES, CATCH_BODY): New macros.
  11243. (EH_FILTER_TYPES, EH_FILTER_FAILURE): New macros.
  11244. * tree-simple.c (is_simple_id): Allow EXC_PTR_EXPR.
  11245. * c-pretty-print.c (dump_c_node) [CLEANUP_POINT_EXPR]: Support.
  11246. * tree-pretty-print.c (dump_generic_node): Likewise.
  11247. [CATCH_EXPR, EH_FILTER_EXPR, EXC_PTR_EXPR]: Support.
  11248. * c-pretty-print.c (NIY): Print operands.
  11249. (dump_c_tree): Don't look at TREE_CHAIN if it doesn't matter.
  11250. (dump_c_node) [ARRAY_TYPE]: Handle non-constant array bounds.
  11251. [CALL_EXPR]: Pass spc down.
  11252. [VTABLE_REF]: Support.
  11253. (op_prio) [TARGET_EXPR]: Support.
  11254. (print_call_name): Handle function pointers.
  11255. * tree-pretty-print.c: Likewise.
  11256. 2002-12-31 Steven Bosscher <s.bosscher@student.tudelft.nl>
  11257. * gimplify.c (create_tmp_var_noc): Remove unused function.
  11258. * tree-simple.h: Kill prototype.
  11259. 2002-12-30 Diego Novillo <dnovillo@redhat.com>
  11260. * tree-flow.h (tree_find_loops): Remove unused declaration.
  11261. 2002-12-29 Daniel Berlin <dberlin@dberlin.org>
  11262. * toplev.c: Add flag_ip, enable by default at -O4+ (This is not
  11263. set in stone, and thus, not documented).
  11264. (decode_f_option): Add warning if andersen's PTA is selected but
  11265. not compiled in.
  11266. * flags.h: Add flag_ip.
  11267. * tree-alias-ander.c: Fix todo.
  11268. (andersen_function_call): Return 1 if we don't need to process
  11269. the function.
  11270. (ptset_map): New map, cache points-to sets.
  11271. (andersen_op): We can do IP on all statics without help.
  11272. (andersen_init): Only init once if we are doing ip analysis.
  11273. (andersen_cleanup): Don't cleanup if we need the info for ip.
  11274. (andersen_add_var): Clear points-to set if it exists already.
  11275. (andersen_add_var_same): Ditto.
  11276. (andersen_function_call): We can do interprocedural analysis on
  11277. statics.
  11278. (andersen_may_alias): Cache points-to sets.
  11279. * c-decl.c (c_expand_body): Don't throw away tree if flag_ip is
  11280. on, even if they are uninlinable, they may be wanted for ip
  11281. optimizations.
  11282. * tree-alias-common.c (get_values_from_constructor): New
  11283. function to collect alias_typevars from constructors.
  11284. (alias_annot): Fix where the GTY is so gengtype picks it up.
  11285. (intra_function_call): Ignore non-pointers for global var
  11286. assignment. What arguments point to can now point to a global var
  11287. as well.
  11288. (find_func_aliases): We need to handle decl's with initials as
  11289. well.
  11290. Only call intra_function_call if we have to.
  11291. Handle constructors.
  11292. (create_fun_alias_var): Incoming pointer arguments could be
  11293. pointing to a global var, unless this is a static function and we
  11294. are doing interprocedural analysis.
  11295. (create_alias_vars): Take an fndecl argument, and use it.
  11296. (init_alias_vars): Handle ip_partial as well.
  11297. (ptr_may_alias_var): Simplify, fix.
  11298. * tree-alias-common.h (tree_alias_ops): function_call now returns
  11299. an int, and we have an extra member named ip_partial.
  11300. * tree-alias-steen.c (steen_ops): We can't do ip_partial.
  11301. (steen_function_call): Update definition and return 1.
  11302. * tree-dfa.c (compute_may_aliases): Call create_alias_vars with
  11303. current_function_decl.
  11304. * tree-flow.h (create_alias_vars): Remove proto from here, it's
  11305. in tree-alias-common.h.
  11306. (tree_perform_ssapre): Take a tree, like the other optimizers.
  11307. * tree-optimize.c (optimize_function_tree): Call
  11308. tree_perform_ssapre with a tree.
  11309. * tree-ssa-pre.c: Remove dead, #if 0'd code.
  11310. (tree_perform_ssapre): Use passed in tree.
  11311. 2002-12-23 Frank Ch. Eigler <fche@redhat.com>
  11312. * tree-mudflap.c (mf_decl_cache_locals, mf_decl_clear_locals): New
  11313. functions.
  11314. (mudflap_c_function): Call them before/after basic transforms.
  11315. (mf_cache_shift_decl_l, ..._mask_l): New variables to track local
  11316. VAR_DECL shadows of cache parameters.
  11317. (mf_build_check_statement_for): Use and update them.
  11318. 2002-12-23 Frank Ch. Eigler <fche@redhat.com>
  11319. * tree-mudflap.c (mx_register_decls): Trust incoming TREE_ADDRESSABLE
  11320. instead of own timetaking analysis.
  11321. (mf_find_addrof, mx_xfn_find_addrof): Removed functions.
  11322. 2002-12-23 Steven Bosscher <s.bosscher@student.tudelft.nl>
  11323. * tree-dfa.c: Add doxygen markers in comments.
  11324. 2002-12-22 Diego Novillo <dnovillo@redhat.com>
  11325. * gimplify.c: Undo the following change:
  11326. 2002-12-11 Diego Novillo <dnovillo@redhat.com>
  11327. * gimplify.c (simplify_return_expr): return statements should
  11328. only have a GIMPLE value as argument.
  11329. * tree-simple.c: Fix grammar for return statements.
  11330. 2002-12-20 Frank Ch. Eigler <fche@redhat.com>
  11331. * tree-mudflap.c (mf_init_extern_trees): Rewrite last change
  11332. without using statement-expressions.
  11333. 2002-12-19 Diego Novillo <dnovillo@redhat.com>
  11334. * tree-cfg.c (build_tree_cfg): Make sure that TV_TREE_CFG
  11335. is popped properly.
  11336. 2002-12-19 Frank Ch. Eigler <fche@redhat.com>
  11337. * tree-mudflap.c (mf_init_extern_trees): Abort gracefully if
  11338. <mf-runtime.h> was not included.
  11339. (*): Correct some minor compiler warnings elsewhere.
  11340. 2002-12-18 Diego Novillo <dnovillo@redhat.com>
  11341. * configure: Regenerate with autoconf 2.13.
  11342. 2002-12-17 Ben Elliston <bje@redhat.com>
  11343. * tree-optimize.c (optimize_function_tree): Temporarily
  11344. disable SSA optimizations if -fmudflap is present.
  11345. 2002-12-16 Ben Elliston <bje@redhat.com>
  11346. * tree-mudflap.c (mx_flag): Assert that the tree node is valid.
  11347. 2002-12-14 Jason Merrill <jason@redhat.com>
  11348. * tree-dump.c (dump_files): Add .generic. Move .inlined after it.
  11349. * tree.h (tree_dump_index): Likewise.
  11350. * c-simplify.c (c_genericize): Emit original and generic dumps here.
  11351. * c-decl.c (c_expand_body): Not here.
  11352. 2002-12-13 Ben Elliston <bje@redhat.com>
  11353. * tree-dfa.c (find_refs_in_expr): Terminate comment.
  11354. 2002-12-12 Steven Bosscher <s.bosscher@student.tudelft.nl>
  11355. * tree-cfg.c: Update doxygen documentation.
  11356. * tree-dfa.c: Add doxygen documentation.
  11357. 2002-12-11 Steven Bosscher <s.bosscher@student.tudelft.nl>
  11358. * tree-cfg.c: Add doxygen markers in comments.
  11359. * tree-optimize.c: Likewise.
  11360. * tree-ssa.c: Likewise.
  11361. 2002-12-11 Diego Novillo <dnovillo@redhat.com>
  11362. * gimplify.c (simplify_return_expr): return statements should only
  11363. have a GIMPLE value as argument.
  11364. * tree-cfg.c (call_expr_flags): New function.
  11365. (is_ctrl_altering_stmt): Call it.
  11366. * tree-flow.h (extern): Declare it.
  11367. 2002-12-06 Diego Novillo <dnovillo@redhat.com>
  11368. * tree-cfg.c (make_goto_expr_edges): Temporary hack to prevent
  11369. removing blocks with nonlocal labels.
  11370. (is_nonlocal_label_block): Return true if DECL_NONLOCAL is set for
  11371. the label.
  11372. * tree-dfa.c (alias_leaders): New local array.
  11373. (num_alias_leaders): New local variable.
  11374. (find_alias_leader): New local function.
  11375. (may_access_global_mem): New local function.
  11376. (find_may_aliases_for): Call them.
  11377. (compute_may_aliases): Allocate and deallocate alias_leaders.
  11378. Show alias information if -fdump-tree-...-alias flag is given.
  11379. (may_alias_p): Return true if both variables are the same.
  11380. (find_refs_in_expr): Strip WFL and NOPs from the parent statement.
  11381. If a pointer relocation is due to a function call, assignment from
  11382. a global or a function argument, mark the pointer as a may-alias
  11383. for global storage.
  11384. (dump_referenced_vars): Reformat output.
  11385. (dump_variable): Likewise.
  11386. * tree-dump.c (dump_option_value_info): Add entry for TDF_ALIAS.
  11387. * tree.h (TDF_ALIAS): Define.
  11388. * doc/invoke.texi: Document new flag.
  11389. * tree-flow-inline.h (may_alias_global_mem_p): New function.
  11390. * tree-flow.h (enum tree_flags): Add value TF_MAY_ALIAS_GLOBAL_MEM.
  11391. (may_alias_global_mem_p): Declare.
  11392. * tree-simple.c (get_base_symbol): Return NULL_TREE, not NULL.
  11393. * tree-ssa-ccp.c (tree_ssa_ccp): Remove unused variable.
  11394. * tree-ssa-dce.c (need_to_preserve_store): Call
  11395. decl_function_context instead of DECL_CONTEXT.
  11396. If the symbol may alias global memory, return nonzero.
  11397. * tree-ssa.c (dump_reaching_defs): Reformat output.
  11398. (set_currdef_for): Walk the alias leader chain, setting CURRDEF for
  11399. all the alias sets that may be affected by the definition.
  11400. 2002-12-06 Daniel Berlin <dberlin@dberlin.org>
  11401. * tree-dfa.c (may_alias_p): Fix global variables and points-to.
  11402. 2002-12-03 Daniel Berlin <dberlin@dberlin.org>
  11403. * tree-ssa.c (delete_tree_ssa): Move call to delete_alias_vars
  11404. above resetting num_referenced_vars.
  11405. 2002-12-03 Diego Novillo <dnovillo@redhat.com>
  11406. * Makefile.in: Add dependencies on $(TM_H) and coretypes.h for the
  11407. files mentioned below.
  11408. * old-tree-inline.c: Include tm.h and coretypes.h.
  11409. * c-pretty-print.c: Likewise.
  11410. * disjoint-set.c: Likewise.
  11411. * tree-alias-ecr.c: Likewise.
  11412. * tree-alias-type.c: Likewise.
  11413. * tree-alias-ander.c: Likewise.
  11414. * tree-alias-steen.c: Likewise.
  11415. * tree-alias-common.c: Likewise.
  11416. * tree-ssa.c: Likewise.
  11417. * tree-ssa-pre.c: Likewise.
  11418. * tree-cfg.c: Likewise.
  11419. * tree-dfa.c: Likewise.
  11420. * tree-optimize.c: Likewise.
  11421. * c-simplify.c: Likewise.
  11422. * gimplify.c: Likewise.
  11423. * tree-browser.c: Likewise.
  11424. * simple-break-elim.c: Likewise.
  11425. * simple-goto-elim.c: Likewise.
  11426. * tree-dchain.c: Likewise.
  11427. * c-call-graph.c: Likewise.
  11428. * tree-simple.c: Likewise.
  11429. * tree-nomudflap.c: Likewise.
  11430. * tree-pretty-print.c: Likewise.
  11431. * tree-ssa-dce.c: Likewise.
  11432. * tree-ssa-ccp.c: Likewise.
  11433. * dependence.c: Likewise.
  11434. * tree-mudflap.c: Likewise
  11435. (mx_xfn_indirect_ref): Use size_type_node instead of c_size_type_node.
  11436. 2002-12-03 Diego Novillo <dnovillo@redhat.com>
  11437. * tree-dfa.c: Undo this change that causes bootstrap
  11438. failures:
  11439. 2002-12-02 Diego Novillo <dnovillo@redhat.com>
  11440. * tree-dfa.c (may_alias_p): Artificial variables
  11441. can also be aliased.
  11442. 2002-12-03 Andreas Jaeger <aj@suse.de>
  11443. * tree-simple.c (right_assocify_expr): Remove unused variable.
  11444. 2002-12-02 Andrew MacLeod <amacleod@redhat.com>
  11445. * gimplify.c (simplify_cleanup_point_expr): gsi_stmt can return NULL,
  11446. use gsi_end.
  11447. * tree-cfg.c (make_blocks): Use gsi_end, gsi_stmt can return NULL. Set
  11448. basic_block for empty_stmt_node containers.
  11449. (make_edges): Stmt's can be NULL.
  11450. (make_ctrl_stmt_edges, make_exit_edges, make_loop_expr_edges,
  11451. make_cond_expr_edges, make_goto_expr_edges, is_nonlocal_label_block,
  11452. block_invalidates_loop, cleanup_control_flow, cleanup_cond_expr_graph,
  11453. cleanup_switch_expr_graph, disconnect_unreachable_case_labels,
  11454. find_taken_edge, tree_cfg2dot, successor_block, is_latch_block,
  11455. switch_parent, first_stmt, last_stmt): Check for first_stmt() or
  11456. last_stmt() returning NULL.
  11457. (remove_tree_bb, first_exec_stmt): Use gsi_end.
  11458. (last_stmt_ptr): Iterate to find last execuatbel stmt_ptr in a block.
  11459. (gsi_start_bb): Return first non-empty stmt, if there is one.
  11460. (set_bb_for_stmt): Don't decend into an empty_stmt_node.
  11461. * tree-dfa.c (find_tree_refs): Use gsi_end.
  11462. (collect_dfa_stats): Use gsi_end_bb.
  11463. * tree-flow-inline.h (gsi_step_bb): split.
  11464. (gsi_step_in_bb): gsi_step with explicit bb specified. Never return
  11465. empty_stmt_node.
  11466. (gsi_start_bb): Move to tree-cfg.c.
  11467. (gsi_end_bb): New. Have we reached the end of a basic block.
  11468. * tree-flow.h (gsi_start_bb): Make external.
  11469. (gsi_end_bb, gsi_step_in_bb): New prototypes.
  11470. * tree-simple.h (gsi_end): renamed from gsi_after_end.
  11471. (gsi_stmt): Return NULL if stmt is an empty_stmt_node or error mark.
  11472. * tree-ssa-ccp.c (simulate_block, substitute_and_fold): Use gsi_end.
  11473. * tree-ssa-dce.c (mark_control_parent_necessary, find_useful_stmts,
  11474. remove_dead_stmts): Use gsi_end_bb.
  11475. (process_worklist): Check for NULL last_stmt.
  11476. * tree-ssa-pre.c (finalize_1): Use gsi_end_bb, gsi_stmt can be NULL.
  11477. 2002-12-02 Diego Novillo <dnovillo@redhat.com>
  11478. * tree-dfa.c (dump_ref): Display '<nil>' for NULL references.
  11479. (dump_phi_args): Handle NULL arguments.
  11480. (may_alias_p): Artificial variables can also be aliased.
  11481. 2002-12-02 Daniel Berlin <dberlin@dberlin.org>
  11482. * tree-ssa-pre.c (okay_injuring_def): inj could be null.
  11483. (get_operand): Use instead of special casing INDIRECT_REF and
  11484. COMPONENT_REF everywhere.
  11485. (names_match_p): Fix.
  11486. (defs_match_p): Ignore partial uses.
  11487. (rename_2): Fix non-matching condition.
  11488. (update_old_new): Update the kills and lefts arrays.
  11489. (finalize_1): Set the bb for the new statement.
  11490. (update_ssa_for_new_use): Ditto.
  11491. (code_motion): Ditto.
  11492. (call_modifies_slot): Handle function pointers (where we end up
  11493. with a _DECL as our argument).
  11494. (pre_part_1_trav): Update the kills and lefts arrays.
  11495. Just use TREE_TYPE (ei->expr) for type of expression.
  11496. (add_left_occ): New helper function.
  11497. (process_left_occs_and_kills): Add other cases we need to handle.
  11498. (tree_perform_ssapre): Add new processed array, since for left
  11499. occurrences and kills, we need to process *all* statements, not
  11500. just ones we might consider candiates for PRE.
  11501. 2002-12-02 Diego Novillo <dnovillo@redhat.com>
  11502. * tree-dfa.c (find_refs_in_expr): Look for references in
  11503. VA_ARG_EXPR nodes.
  11504. 2002-12-01 Diego Novillo <dnovillo@redhat.com>
  11505. * tree-optimize.c (optimize_function_tree): Undo
  11506. inadvertent change in previous commit.
  11507. 2002-12-01 Diego Novillo <dnovillo@redhat.com>
  11508. * fold-const.c (operand_equal_p): Check for NULL TREE_TYPEs.
  11509. * tree-cfg.c (remove_stmt): Call remove_ref.
  11510. (disconnect_unreachable_case_labels): Do not disconnect the edge
  11511. going to the block holding the BIND_EXPR node for the switch()
  11512. body.
  11513. (dump_tree_cfg): Call dump_current_function.
  11514. * Makefile.in (tree-dfa.o): Depend on convert.h.
  11515. * tree-dfa.c: Include convert.h.
  11516. (remove_def): New local function.
  11517. (reset_def_def_links): New local function.
  11518. (replace_phi_arg_with): New local function.
  11519. (replace_ref_with): New function.
  11520. (try_replace_ref_with): Rename from replace_ref_in.
  11521. Also look for V_USE references on the LHS of assignments.
  11522. When replacing the callee of a CALL_EXPR, make sure that the type
  11523. of the new callee is compatible with the old one.
  11524. (replace_ref_r): Call operand_equal_p.
  11525. (remove_ref): New function.
  11526. (same_var_p): New function.
  11527. (dump_referenced_vars): Add new flag DETAILS. Update all users.
  11528. (debug_referenced_vars): Likewise.
  11529. * tree-ssa.c (dump_reaching_defs): Change output format.
  11530. (set_ssa_links): Don't set def-def links for PHI nodes.
  11531. * tree-ssa-ccp.c (replace_uses_in): Add new argument COMMIT.
  11532. Update all users.
  11533. * tree-optimize.c (dump_current_function): New function.
  11534. (optimize_function_tree): Call it.
  11535. * tree.h (dump_current_function): Declare.
  11536. * c-decl.c (c_expand_body): Call dump_current_function.
  11537. * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Likewise.
  11538. * tree-ssa-pre.c (tree_perform_ssapre): Likewise.
  11539. * tree-ssa.c (build_tree_ssa): Likewise.
  11540. * tree-ssa-ccp.c (tree_ssa_ccp): Likewise.
  11541. Dump variables and reaching definitions if TDF_DETAILS is set.
  11542. * tree-pretty-print.c (print_call_name): Call dump_generic_node for
  11543. NOP_EXPR operands.
  11544. * tree-ssa-pre.c: Don't include c-common.h nor c-tree.h
  11545. Replace calls to build_modify_expr with build everywhere.
  11546. Replace calls to deep_copy_node with copy_node_r everywhere.
  11547. 2002-11-29 Andreas Jaeger <aj@suse.de>
  11548. * c-call-graph.c (construct_call_graph): Fix format.
  11549. * tree-alias-ander.c: Declare print_out_result.
  11550. * tree-ssa-pre.c: Declare is_on_lhs and call_modifies_slot.
  11551. * tree.h: Declare expand_asm_expr and add_var_to_bind_expr.
  11552. * tree-inline.c: Declare remap_decls.
  11553. 2002-11-28 Daniel Berlin <dberlin@dberlin.org>
  11554. * tree-alias-common.h: Start adding doxygen docs.
  11555. * tree-alias-common.c: Ditto
  11556. 2002-11-28 Daniel Berlin <dberlin@dberlin.org>
  11557. * tree-alias-ander.c: Convert debug defines and ifdefs into
  11558. dump_file use.
  11559. * tree.h: Add TDI_pta.
  11560. * tree-dump.c: Add dump-tree-pta and TDI_pta.
  11561. 2002-11-28 Diego Novillo <dnovillo@redhat.com>
  11562. * Makefile.in (tree-ssa-pre.o, tree-cfg.o, gimplify.o, tree-ssa-dce.o,
  11563. tree-ssa-ccp.o): Add dependency on $(TIMEVAR_H).
  11564. * timevar.def (TV_TREE_GIMPLIFY, TV_TREE_MAY_ALIAS,
  11565. TV_TREE_INSERT_PHI_NODES, TV_TREE_BUILD_FUD_CHAINS, TV_TREE_RDEFS):
  11566. New timers.
  11567. (TV_TREE_SSA): Remove.
  11568. (TV_INTEGRATION, TV_EXPAND): Switch order.
  11569. * c-decl.c (c_expand_body): Pop TV_EXPAND before running the tree
  11570. optimizers.
  11571. * gimplify.c (simplify_function_tree): Push/pop TV_TREE_GIMPLIFY.
  11572. * tree-cfg.c (build_tree_cfg): Push/pop TV_TREE_CFG.
  11573. * tree-dfa.c (compute_may_aliases): Push/pop TV_TREE_MAY_ALIAS.
  11574. * tree-ssa-ccp.c (tree_ssa_ccp): Push/pop TV_TREE_CCP.
  11575. * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Push/pop
  11576. TV_TREE_DCE.
  11577. Call compute_reaching_defs.
  11578. Remove debugging dumps before DCE.
  11579. * tree-ssa-pre.c (tree_perform_ssapre): Push/pop TV_TREE_PRE.
  11580. * tree-ssa.c (build_tree_ssa): Don't call compute_reaching_defs.
  11581. Don't call dump_reaching_defs.
  11582. (insert_phi_nodes): Push/pop TV_TREE_INSERT_PHI_NODES.
  11583. (build_fud_chains): Push/pop TV_TREE_BUILD_FUD_CHAINS.
  11584. (compute_reaching_defs): Push/pop TV_TREE_RDEFS.
  11585. Call dump_reaching_defs.
  11586. * tree-optimize.c (optimize_function_tree): Remove calls to
  11587. timevar_push and timevar_pop.
  11588. 2002-11-28 Diego Novillo <dnovillo@redhat.com>
  11589. * Makefile.in (tree-ssa.o): Add dependency on $(TIMEVAR_H) and
  11590. tree-alias-common.h.
  11591. (tree-dfa.o): Likewise.
  11592. (tree-optimize.o): Add dependency on $(TIMEVAR_H).
  11593. * tree-dfa.c (compute_may_aliases): Move call to delete_alias_vars
  11594. * tree-ssa.c (delete_tree_ssa): ... here.
  11595. 2002-11-27 Diego Novillo <dnovillo@redhat.com>
  11596. * tree-dfa.c (add_may_alias): Remove. Update all users.
  11597. (get_alias_index): Remove. Update all users.
  11598. (dfa_stats_d): Remove fields num_may_alias, max_num_may_alias,
  11599. num_alias_imm_rdefs and max_num_alias_imm_rdefs. Update all users.
  11600. (may_alias_p): Make extern. Move declaration to tree-flow.h.
  11601. (TRM_DEFAULT): Remove. Update all users. Update values of the
  11602. other TRM_* constants.
  11603. (create_ref): Don't initialize the PHI argument array with the
  11604. number of incoming edges.
  11605. (collect_dfa_stats): Do not traverse the function body with
  11606. walk_tree.
  11607. Free temporary hash table before returning.
  11608. (compute_may_aliases): Update comment.
  11609. (may_alias_p): Switch arguments if the first argument is not an
  11610. INDIRECT_PTR or the artificial global_var.
  11611. (find_may_aliases_for): If a pointer aliases a variable, set the
  11612. pointer to be the alias leader for the variable.
  11613. (ref_defines): Call may_alias_p.
  11614. (is_killing_def): Return false if the reaching definition is NULL.
  11615. Don't check for volatile definitions.
  11616. Change second argument to be a tree. Update all users.
  11617. * tree-flow-inline.h (alias_imm_reaching_def): Remove. Update all
  11618. users.
  11619. (may_alias): Remove. Update all users.
  11620. (set_imm_reaching_def): Check for circularity.
  11621. (alias_leader): New function.
  11622. (set_alias_leader): New function.
  11623. (is_aliased): New function.
  11624. (is_default_def): Remove. Update all users.
  11625. * tree-flow.h (struct var_ref_d): Remove field alias_imm_rdefs.
  11626. Update all users.
  11627. (struct var_def_d): Remove field m_default. Update all users.
  11628. (struct tree_ann_d): Remove field may_aliases. Update all users.
  11629. Add field alias_leader.
  11630. (struct dfa_counts_d): Remove fields num_may_alias and
  11631. num_may_alias_imm_rdefs. Update all users.
  11632. * tree-ssa.c: Update documentation on may-alias processing.
  11633. (set_ssa_links): Remove third argument. Update all users.
  11634. (set_alias_imm_reaching_def): Remove. Update all users.
  11635. (create_default_def): Likewise.
  11636. (analyze_rdefs): Likewise.
  11637. (currdef_for): Move from tree-flow-inline.h
  11638. (set_currdef_for): Likewise.
  11639. (compute_reaching_defs): Rename from compute_tree_rdefs. Update
  11640. all users.
  11641. (follow_chain): Call is_killing_def instead of is_partial_def.
  11642. (tree_ssa_remove_phi_alternative): Remove unused variable ref.
  11643. (set_ssa_links): When processing V_USE references, make sure that
  11644. CURRDEF is a definition for the variable or one of its aliases.
  11645. 2002-11-26 Sebastian Pop <s.pop@laposte.net>
  11646. * Makefile.in (OBJS): Add tree-browser.o.
  11647. (tree-browser.o): New dependency.
  11648. * tree-browser.c: New file.
  11649. * tree-browser.def: New file.
  11650. 2002-11-26 Jason Merrill <jason@redhat.com>
  11651. Gimplify C++ cleanups.
  11652. * gimplify.c (voidify_wrapper_expr): Split out from...
  11653. (simplify_bind_expr): ...here.
  11654. (simplify_cleanup_point_expr): New fn.
  11655. (simplify_target_expr): New fn.
  11656. (gimple_conditional_context): New fn.
  11657. (gimple_push_condition, gimple_pop_condition): New fns.
  11658. (simplify_expr) [TRY_CATCH_EXPR]: Handle like TRY_FINALLY_EXPR.
  11659. * c-simplify.c (simplify_cleanup): New fn.
  11660. (c_simplify_stmt): Call it and lang_simplify_stmt.
  11661. (simplify_expr_stmt): Wrap the expr in a CLEANUP_POINT_EXPR.
  11662. (simplify_return_stmt, simplify_decl_stmt): Likewise.
  11663. (simplify_stmt_expr): Handle the STMT_EXPR_NO_SCOPE case.
  11664. (is_last_stmt_of_scope): Likewise.
  11665. * c-common.h: Declare c_genericize, c_simplify_stmt and
  11666. lang_simplify_stmt.
  11667. * c-common.c (lang_simplify_stmt): Define.
  11668. Gimplify EXIT_EXPRs.
  11669. * gimplify.c (gimplify_loop_expr, gimplify_exit_expr): New fns.
  11670. (simplify_expr): Call them.
  11671. * expr.c (expand_expr) [LOOP_EXPR]: Pass 1 again for exit_flag.
  11672. * tree-simple.c (right_assocify_expr): Also set TREE_SIDE_EFFECTS.
  11673. * gimplify.c (simplify_expr): Call STRIP_TYPE_NOPS.
  11674. [REALPART_EXPR]: Don't just return.
  11675. * tree-pretty-print.c (dump_c_node): Handle REFERENCE_TYPE.
  11676. * c-pretty-print.c (dump_c_node): Likewise. Handle null FOR_INIT_STMT.
  11677. 2002-11-25 Daniel Berlin <dberlin@dberlin.org>
  11678. * config.gcc: Try committing the correct version.
  11679. * tree-alias-ander.c (andersen_may_alias): Add "!= NULL" to make
  11680. return a bool.
  11681. 2002-11-24 Daniel Berlin <dberlin@dberlin.org>
  11682. * configure.in: Add --with-libbanshee, passed to us by toplevel if
  11683. libbanshee was configured. Substitute appropriate definitions for
  11684. Makefile (IE disabling tree-alias-ander building) if it wasn't.
  11685. * config.in: Regenerated.
  11686. * config.gcc: Rebuild libbanshee with stage1 on darwin to work
  11687. around system compiler problem.
  11688. * configure: Regenerated.
  11689. * Makefile.in: Add banshee stuff.
  11690. * tree-alias-ander.c: New file.
  11691. * tree-alias-ander.h: New file.
  11692. * tree-alias-common.c (get_alias_var): Fix field based stuff.
  11693. (find_func_aliases): Don't walk subtrees if we processed the tree.
  11694. (ptr_may_alias_var): Fix both field-based and non-field-based lookup.
  11695. 2002-11-22 Andrew MacLeod <amacleod@redhat.com>
  11696. * tree-ssa-dce.c (mark_necessary): Split out mark_tree_necessary. Don't
  11697. mark if tree is already marked.
  11698. (mark_tree_necessary): New. Mark tree without processing control parent.
  11699. (mark_control_parent_necessary): Remove recursion, mark trees directly.
  11700. (need_to_preserve_store): Can expression/symbol affect external values.
  11701. (tree_ssa_eliminate_dead_code): Split.
  11702. (find_useful_stmts): Find initial set of needed statements.
  11703. (process_worklist): Find statements which calculate needed statements.
  11704. (remove_dead_stmts): Delete statements which are dead.
  11705. 2002-11-16 Jason Merrill <jason@redhat.com>
  11706. Improve tree dumps.
  11707. * c-pretty-print.c, tree-pretty-print.c (dump_c_node): Handle
  11708. integers larger than a host word.
  11709. (op_prio): Handle INIT_EXPR.
  11710. * gimplify.c (simplify_bind_expr): Set TREE_SIDE_EFFECTS and type
  11711. of void_type_node on the COMPOUND_EXPRs as we walk.
  11712. * tree-simple.c (right_assocify_expr): Propagate the type from cur
  11713. rather than rhs.
  11714. * c-decl.c (finish_function): Call c_genericize instead of
  11715. simplify_function_tree.
  11716. * c-simplify.c (c_genericize): New function.
  11717. (simplify_stmt_expr): Just genericize.
  11718. (simplify_compound_literal_expr): Likewise.
  11719. (c_build_bind_expr): Don't build a block for an artificial decl.
  11720. (simplify_decl_stmt): Add the variable to the temps list iff it's
  11721. artificial.
  11722. (c_simplify_expr): Don't call push/pop_context.
  11723. * c-decl.c (build_compound_literal): Set DECL_ARTIFICIAL.
  11724. * c-tree.h: Declare c_genericize.
  11725. * c-simplify.c (tree_build_scope): Remove.
  11726. Remove INIT_EXPR from GIMPLE.
  11727. * c-simplify.c (simplify_decl_stmt): Use MODIFY_EXPR.
  11728. * gimplify.c (simplify_bind_expr): Likewise.
  11729. (simplify_modify_expr): Convert INIT_EXPR to MODIFY_EXPR.
  11730. * c-simplify.c (create_tmp_var_1): Drop; change all users to call
  11731. create_tmp_var.
  11732. (gimple_add_tmp_var): Now adds to the external temps list if
  11733. available, or directly to the function otherwise.
  11734. Avoid gratuitous unused warnings.
  11735. * c-simplify.c (simplify_expr_stmt): Check TREE_SIDE_EFFECTS
  11736. directly. Also check for explicit conversions to void.
  11737. (expr_has_effect): Remove.
  11738. * Makefile.in (OBJS): Remove tree-dchain.o.
  11739. * stor-layout.c (variable_size): We don't care about
  11740. global_bindings_p if the frontend doesn't want a list of the
  11741. expressions.
  11742. 2002-11-13 Diego Novillo <dnovillo@redhat.com>
  11743. * toplev.c (parse_options_and_default_flags): Enable SSA-CCP by
  11744. default with optimization >= 1.
  11745. * tree-dfa.c (find_refs_in_expr): Clobber '*.GLOBAL_VAR', not
  11746. 'GLOBAL_VAR'.
  11747. (collect_dfa_stats): Collect statistics on '*.GLOBAL_VAR'.
  11748. (compute_may_aliases): Make sure that variable is an INDIRECT_REF.
  11749. (may_alias_p): GLOBAL_VAR should alias INDIRECT_REFs.
  11750. Only check addressability on VAR_DECLs.
  11751. (find_may_aliases_for): Make sure argument is an INDIRECT_REF.
  11752. * tree-flow-inline.h (indirect_var): Call DECL_P.
  11753. (set_indirect_var): Call DECL_P.
  11754. Create annotation if it doesn't exist.
  11755. (create_indirect_ref): Move from tree-dfa.c.
  11756. * tree-flow.h (create_indirect_ref): Declare.
  11757. * tree-ssa-ccp.c (visit_phi_node): Avoid debugging dump from
  11758. accessing uninitialized data.
  11759. * tree-ssa.c (init_tree_ssa): Create an INDIRECT_REF node for
  11760. .GLOBAL_VAR.
  11761. 2002-11-12 Diego Novillo <dnovillo@redhat.com>
  11762. * tree-cfg.c (delete_tree_cfg): Call free_aux_for_blocks.
  11763. Call free_basic_block_vars.
  11764. * gimplify.c (simplify_expr): VA_ARG_EXPR nodes are in GIMPLE form
  11765. already.
  11766. Gimplify BIT_FIELD_REF nodes.
  11767. (simplify_call_expr): Update comment.
  11768. * tree-dfa.c (find_refs_in_expr): VA_ARG_EXPR nodes make no
  11769. data references.
  11770. Handle BIT_FIELD_REF nodes.
  11771. * tree-pretty-print.c (op_prio): Don't write an error message if
  11772. the operand is not recognized.
  11773. * tree-simple.c (is_simple_unary_expr): Handle BIT_FIELD_REFs.
  11774. (is_simplifiable_builtin): Only return false for MD builtins.
  11775. 2002-11-08 Diego Novillo <dnovillo@redhat.com>
  11776. * tree-cfg.c (cleanup_switch_expr_graph): Handle edges going to
  11777. EXIT_BLOCK_PTR.
  11778. (first_stmt): Return NULL for ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR and
  11779. INVALID_BLOCK.
  11780. * tree-dfa.c (find_refs_in_expr): Call mark_not_simple.
  11781. 2002-11-07 Diego Novillo <dnovillo@redhat.com>
  11782. * Makefile.in (tree-ssa.o, tree-cfg.o, tree-dfa.o): Add dependency
  11783. on function.h
  11784. * tree-cfg.c: Include function.h.
  11785. (build_tree_cfg): Set dump_file to NULL after closing the file.
  11786. (remove_tree_bb): Don't dump warnings about statements being
  11787. removed.
  11788. (dump_tree_cfg): Use current_function_name.
  11789. Check that the flowgraph is not empty before dumping the function
  11790. body.
  11791. (tree_cfg2dot): Use current_function_name.
  11792. * tree-dfa.c: Include function.h
  11793. (dump_dfa_stats): Use current_function_name.
  11794. * tree-optimize.c (optimize_function_tree): Set dump_file to NULL
  11795. after closing the file.
  11796. * tree-pretty-print.c (dump_generic_node): Make sure that the
  11797. flowgraph exists before displaying block boundaries.
  11798. * tree-ssa-ccp.c (tree_ssa_ccp): Set dump_file to NULL after
  11799. closing the file.
  11800. * tree-ssa.c: Include function.h.
  11801. (build_tree_ssa): Set tree_ssa_dump_file to NULL after closing the
  11802. file.
  11803. (dump_reaching_defs): Use current_function_name.
  11804. (dump_tree_ssa): Likewise.
  11805. 2002-11-07 Diego Novillo <dnovillo@redhat.com>
  11806. * tree-cfg.c (successor_block): Return EXIT_BLOCK_PTR if no
  11807. successor can be found while walking the nesting chain.
  11808. 2002-11-07 Diego Novillo <dnovillo@redhat.com>
  11809. * tree-cfg.c: Fix some formatting in code and comments.
  11810. (set_bb_for_stmt): Move from tree-flow-inline.h
  11811. * tree-dfa.c: Fix some formatting in code and comments.
  11812. * tree-flow-inline.h: Likewise.
  11813. * tree-flow.h: Likewise.
  11814. * tree-ssa.c: Likewise.
  11815. 2002-11-06 Diego Novillo <dnovillo@redhat.com>
  11816. * Makefile.in (tree-ssa-ccp.o): Add dependency on tree-inline.h
  11817. * tree-cfg.c (find_taken_edge): New function.
  11818. (cleanup_cond_expr_graph): Call it.
  11819. (disconnect_unreachable_case_labels): Call it.
  11820. * tree-dfa.c (struct clobber_data_d): Remove field
  11821. parent_expr_p. Update all users.
  11822. (find_refs_in_expr): Remove argument parent_expr_p. Update all users.
  11823. (create_ref): Remove arguments parent_expr_p and operand_p. Update
  11824. all users.
  11825. (replace_ref_in): Rename from replace_ref_operand_with. Update all
  11826. users. Find the operand in the statement and replace it with a new
  11827. operand.
  11828. (replace_ref_r): New local function.
  11829. (is_killing_def): Also handle V_PHI references.
  11830. (output_ref): Move from tree-flow-inline.h
  11831. * tree-flow-inline.h (ref_expr): Remove. Update all users.
  11832. (restore_ref_operand): Remove. Update all users.
  11833. (set_output_ref): Remove. Update all users.
  11834. (is_assignment_stmt): New function.
  11835. (is_may_def, is_may_use, is_partial_def, is_partial_use,
  11836. is_volatile_def, is_volatile_use, is_default_def,
  11837. is_clobbering_def, is_initializing_def, is_relocating_def,
  11838. is_addressof_use, is_pure_use): Check reference type first.
  11839. (is_pure_def): New function.
  11840. * tree-flow.h (struct tree_ref_common): Remove fields expr_p,
  11841. operand_p and orig_operand. Update all users.
  11842. (struct tree_ann_d): Remove field output_ref. Update all users.
  11843. * tree-ssa-ccp.c: Include tree-inline.h.
  11844. (simulate_block): Simulate every statement in the block, not its
  11845. references
  11846. (simulate_def_use_chains): Simulate statements containing uses
  11847. reached by the definition.
  11848. (substitute_and_fold): Traverse statements, not references.
  11849. Call fold_stmt.
  11850. (visit_phi_node): If PHI node is marked volatile, assume varying.
  11851. (visit_stmt): Rename from visit_expression_for. Work on a
  11852. statement, not a reference.
  11853. (visit_assignment): Rename from visit_assignment_for. Work on a
  11854. statement, not a reference.
  11855. (visit_cond_stmt): Rename from visit_condexpr_for. Work on a
  11856. statement, not a reference.
  11857. (evaluate_stmt): Rename from evaluate_expr. Work on a statement,
  11858. not a reference.
  11859. (initialize): Initialize special definitions to varying.
  11860. (replace_uses_in): Work on a statement, not an expression.
  11861. (fold_stmt): Rename from ccp_fold. Work on a statement, not an
  11862. expression.
  11863. (get_rhs): New local function.
  11864. (set_rhs): New local function.
  11865. 2002-11-06 Daniel Berlin <dberlin@dberlin.org>
  11866. * tree-flow.h: Prototype set_bb_for_stmt, last_stmt_ptr,
  11867. add_ephi_arg, num_ephi_args, set_ephi_arg, ephi_arg.
  11868. (enum tree_ref_type): Add E_LEFT, E_KILL, E_EXIT.
  11869. * tree-cfg.c (set_bb_for_stmt): Move to tree-flow-inline.h.
  11870. (last_stmt_ptr): New function, gives pointer to last statement in
  11871. bb.
  11872. * tree-flow-inline.h: Add exprref_processed, exprref_processed2,
  11873. expruse_phi, num_ephi_args, set_ephi_arg, ephi_arg, add_ephi_arg.
  11874. * tree-dfa.c (tree_ref_structure): Handle E_{LEFT,KILL,EXIT}.
  11875. (ref_type_name): Ditto.
  11876. (tree_ref_size): Ditto.
  11877. (dump_ref): E_PHI's phi_args is now a varray of phi_arg structs.
  11878. (add_ephi_arg): New function.
  11879. (remove_ref_from_list): Fix crash when node not found.
  11880. (compute_may_aliases): Add timing for points-to analysis.
  11881. * timevar.def: Add TV_TREE_PTA.
  11882. * tree-ssa-pre.c: Start of massive cleanup and rewriting (in
  11883. preparation for load/store PRE). No more uses of ref_expr, proper
  11884. call handling. Started removing unnecessary structures and lists,
  11885. started removing redundant and inefficient operations (IE O(n^2)
  11886. loops to process all phi operands, etc). Basic load PRE implemented.
  11887. Code may look ugly due to large pieces commented out waiting for DFA
  11888. updating of refs to redo.
  11889. 2002-11-05 Diego Novillo <dnovillo@redhat.com>
  11890. * tree-cfg.c (create_block_annotations): New local function.
  11891. (create_bb_ann): Remove. Update all users.
  11892. (parent_array): New local variable.
  11893. (build_tree_cfg): Initialize it.
  11894. Call create_block_annotations.
  11895. (create_bb): Call alloc_block instead of ggc_alloc to allocate
  11896. memory for basic blocks.
  11897. Don't call set_parent_block.
  11898. Grow array parent_array.
  11899. (dump_tree_cfg): Change meaning of second argument. Make it accept
  11900. any of the TDF_* flags defined in tree.h.
  11901. (delete_tree_cfg): Call free_aux_for_blocks.
  11902. Free array parent_array.
  11903. * tree-flow-inline.h (get_filename): New function.
  11904. (is_exec_stmt): return false if T is error_mark_node.
  11905. * tree-flow.h (struct var_ref_d): Mark alias_imm_rdefs field for
  11906. garbage collection.
  11907. (get_filename): Declare.
  11908. (struct bb_ann_d): Rename from bb_ann_def.
  11909. Remove garbage collection markers.
  11910. (referenced_vars): Mark for garbage collection.
  11911. (global_var): Likewise.
  11912. (create_bb_ann): Remove.
  11913. * tree-optimize.c (optimize_function_tree): Remove CFG and SSA
  11914. after debugging dumps.
  11915. * diagnostic.h (print_generic_stmt): Rename from print_generic_tree.
  11916. Update all users.
  11917. (print_generic_expr): Rename from print_generic_node. Update all
  11918. users.
  11919. (PPF_BRIEF): Remove. Update all users.
  11920. (PPF_BLOCK): Remove. Update all users.
  11921. (PPF_LINENO): Remove. Update all users.
  11922. (PPF_IS_STMT): Remove. Update all users.
  11923. * flags.h (flag_dump_tree_all_ssa): Remove. Update all users.
  11924. * toplev.c (f_options): Remove entry for -fdump-tree-all-ssa.
  11925. Update all users.
  11926. * tree-dump.c (dump_enable_all): Rename from dump_enable_all_ssa.
  11927. Update all users.
  11928. (dump_files): Add entry for -fdump-tree-all.
  11929. (dump_option_value_info): Remove entries for TDF_REFS and
  11930. TDF_RDEFS.
  11931. Add entry for TDF_BLOCK.
  11932. (dump_switch_p): If -fdump-tree-all was given, call dump_enable_all.
  11933. * tree-pretty-print.c (PPF_BRIEF): Remove. Update all users.
  11934. (PPF_BLOCK): Remove. Update all users.
  11935. (PPF_LINENO): Remove. Update all users.
  11936. (PPF_IS_STMT): Remove. Update all users.
  11937. (dumping_stmts): New local variable.
  11938. (print_generic_stmt): Rename from print_generic_tree. Update all
  11939. users.
  11940. Set dumping_stmts to true.
  11941. (print_generic_expr): Rename from print_generic_node. Update all
  11942. users.
  11943. Set dumping_stmts to false.
  11944. (maybe_init_pretty_print): Set last_bb to -1.
  11945. (dump_block_info): If available, dump file and line number
  11946. information for the first statement in the basic block.
  11947. * tree-ssa.c (build_tree_ssa): Dump referenced variables and
  11948. reaching definition information if -details is given.
  11949. * tree.h (enum tree_dump_index): Rename TDI_all to TDI_tu. Update
  11950. all users.
  11951. Add new index TDI_all.
  11952. (TDF_DETAILS): Change value.
  11953. (TDF_REFS): Remove. Update all users.
  11954. (TDF_RDEFS): Remove. Update all users.
  11955. (TDF_BLOCK): Define.
  11956. * doc/invoke.texi: Update documentation for -fdump-tree-... flags.
  11957. 2002-11-05 Frank Ch. Eigler <fche@redhat.com>
  11958. * tree-mudflap.c (mudflap_enqueue_decl, _constant): Use
  11959. size_in_bytes, not c_size_in_bytes.
  11960. (mf_init_extern_trees): Import uintptr_t typedef node from
  11961. mf-runtime.h.
  11962. 2002-11-01 Diego Novillo <dnovillo@redhat.com>
  11963. * tree-cfg.c (remove_tree_bb): Add new argument remove_stmts.
  11964. Update all callers.
  11965. (make_ctrl_stmt_edges): Add an edge to the body of a SWITCH_EXPR.
  11966. (make_cond_expr_edges): Don't try to linearize the if() subgraph.
  11967. (make_case_label_edges): Don't remove the fallthru edge from the
  11968. entry block to the switch() subgraph.
  11969. (cleanup_tree_cfg): Call cleanup_control_flow.
  11970. (remove_unreachable_blocks): Remove blocks of compound structures
  11971. before removing the entry block.
  11972. (remove_blocks): New local function.
  11973. (blocks_unreachable_p): New local function.
  11974. (is_nonlocal_label_block): New local function.
  11975. (find_subblocks): New local function.
  11976. (is_parent): New local function.
  11977. (gsi_remove): New function.
  11978. (remove_stmt): New local function.
  11979. (cleanup_control_flow): New local function.
  11980. (cleanup_cond_expr_graph): New local function.
  11981. (cleanup_switch_expr_graph): New local function.
  11982. (disconnect_unreachable_case_labels): New local function.
  11983. * tree-dfa.c (remove_decl): New function.
  11984. (find_decl_location): New function.
  11985. * tree-flow.h (gsi_remove): Declare.
  11986. (remove_decl): Declare.
  11987. (find_decl_location): Declare.
  11988. * tree-ssa-ccp.c (optimize_unexecutable_edges): Remove. Update all
  11989. users.
  11990. (ssa_ccp_df_delete_unreachable_insns): Remove. Update all users.
  11991. (tree_ssa_ccp): Call print_generic_tree with PPF_BLOCK.
  11992. 2002-10-31 Diego Novillo <dnovillo@redhat.com>
  11993. * tree-dfa.c (create_indirect_ref): New local function.
  11994. (find_refs_in_expr): Call it.
  11995. (create_ref): Check E_* reference types with == instead of &.
  11996. (dump_ref): Likewise.
  11997. (count_tree_refs): Likewise.
  11998. * tree-ssa.c (set_ssa_links): Update documentation comment for
  11999. save_chain.
  12000. 2002-10-31 Diego Novillo <dnovillo@redhat.com>
  12001. * tree-cfg.c (remove_tree_bb): Don't walk beyond the end of the
  12002. basic block.
  12003. 2002-10-26 Daniel Berlin <dberlin@dberlin.org>
  12004. * flags.h: Remove flag_tree_points_to from here.
  12005. * toplev.c: Include tree-alias-common.h.
  12006. (flag_tree_points_to): Now of type enum pta_type, rather than
  12007. int.
  12008. (lang_independent_options): Remove flag_tree_points_to.
  12009. (display_help): Display help for tree-points-to here.
  12010. (decode_f_option): Allow selecting of points-to algorithm.
  12011. * tree-alias-common.c (varmap): Removed.
  12012. (alias_annot): Changed to a hash table. Update all functions
  12013. appropriately.
  12014. (FIELD_BASED): New macro, switches between field-based analysis,
  12015. and field-independent analysis (field-based isn't quite done yet).
  12016. (alias_annot_entry): New, used in hash table.
  12017. (annot_eq): New function.
  12018. (annot_hash): New function.
  12019. (find_func_aliases): Handle casts, fix indendation.
  12020. (splaycount): Removed.
  12021. (splay_tree_count): Removed.
  12022. (display_points_to_set): Removed.
  12023. (splay_tree_size): Removed.
  12024. (alias_get_name): New function.
  12025. (ptr_may_alias_var): Globals are a bit funky to handle.
  12026. * tree-alias-steen.c: Use alias_get_name, rather than
  12027. print_generic_node.
  12028. (steen_simple_assign): Handle assignment of PTF's.
  12029. (test_assign): Remove.
  12030. * tree-alias-common.h (enum pta_type): New.
  12031. (alias_get_name): New.
  12032. (flag_tree_points_to): New.
  12033. 2002-10-26 Diego Novillo <dnovillo@redhat.com>
  12034. * tree-cfg.c (cleanup_tree_cfg): Uncomment call to
  12035. compact_blocks.
  12036. 2002-10-26 Diego Novillo <dnovillo@redhat.com>
  12037. * Makefile.in (tree-pretty-print.o): Depend on $(TREE_FLOW_H)
  12038. * basic-block.h (BB_COMPOUND_ENTRY): Rename from BB_CONTROL_ENTRY.
  12039. * diagnostic.h (dump_generic_tree): Remove extern declaration.
  12040. (print_generic_node_brief): Remove. Update all users.
  12041. (PPF_BRIEF): Declare.
  12042. (PPF_BLOCK): Declare.
  12043. (PPF_LINENO): Declare.
  12044. (PPF_IS_STMT): Declare.
  12045. * tree-pretty-print.c (PPF_BRIEF): New constant.
  12046. (PPF_BLOCK): New constant.
  12047. (PPF_LINENO): New constant.
  12048. (PPF_IS_STMT): New constant.
  12049. (dump_block_info): New local function.
  12050. (last_bb): New local variable.
  12051. (dump_generic_tree): Remove unused function.
  12052. (print_generic_tree): Add third argument 'flags'. Update all
  12053. users.
  12054. (print_generic_node_brief): Remove. Update all users.
  12055. (print_generic_node): Add third argument 'flags'. Update all
  12056. users.
  12057. (dump_generic_node): Add third argument 'flags'. Update all users.
  12058. If PPF_BLOCK is set, display basic block information at basic block
  12059. boundaries.
  12060. If PPF_IS_STMT is set, change the way COMPOUND_EXPR nodes are
  12061. rendered.
  12062. If PPF_BRIEF is set, don't show the bodies of control statements.
  12063. (print_declaration):
  12064. * toplev.c (process_options): Update comment for -fdisable-simple.
  12065. * tree-cfg.c (remove_tree_bb): Rename from tree_delete_bb.
  12066. (latch_block): Move declaration to tree-flow.h. Declare extern.
  12067. (make_blocks): Start a new block after finding a control flow
  12068. altering statement.
  12069. (make_loop_expr_blocks): Set the loop entry block to be the parent
  12070. block for the loop latch block.
  12071. (cleanup_tree_cfg): Rename from tree_cleanup_cfg.
  12072. Call compact_blocks.
  12073. (remove_tree_bb): Rename from tree_delete_bb. Update all users.
  12074. (dump_tree_bb): Rename from dump_tree_bb. Update all users.
  12075. Dump information about loop latch blocks.
  12076. (debug_tree_bb): Rename from tree_debug_bb. Update all users.
  12077. (debug_tree_cfg): Rename from tree_debug_cfg. Update all users.
  12078. (dump_tree_cfg): Rename from tree_dump_cfg. Update all users.
  12079. By default, dump the function with markers for basic block
  12080. boundaries.
  12081. (successor_block): If we can't find a successor following the
  12082. parent chain, return the next block in the linked list of blocks.
  12083. Update documentation comments.
  12084. (stmt_starts_bb_p): Don't let RETURN_EXPR start a new block.
  12085. (is_latch_block): New function.
  12086. (first_exec_stmt): Don't treat BIND_EXPR nodes as a special case.
  12087. (first_stmt): Return NULL_TREE if the block does not exist.
  12088. (last_stmt): Likewise.
  12089. * tree-dfa.c (find_tree_refs): Rename from tree_find_refs. Update
  12090. all users.
  12091. (find_refs_in_stmt): Handle BIND_EXPR nodes.
  12092. (rli_start): Move from tree-flow-inline.h
  12093. (rli_start_last): Likewise.
  12094. (rli_start_at): Likewise.
  12095. (rli_delete): Likewise.
  12096. * tree-flow-inline.h (gsi_start_bb): Handle NULL blocks.
  12097. (ref_list_is_empty): New function.
  12098. * tree-flow.h (rli_start): Change declaration to extern.
  12099. (rli_start_last): Likewise.
  12100. (rli_start_at): Likewise.
  12101. (rli_delete): Declare.
  12102. (latch_block): Declare.
  12103. (is_latch_block): Declare.
  12104. (get_last_ref): Change to inline declaration.
  12105. (get_first_ref): Likewise.
  12106. (ref_list_empty): Declare.
  12107. * tree-optimize.c (delete_tree_ssa): Remove declaration.
  12108. * tree-ssa-dce.c (mark_control_parent_necessary): Call gsi_step_bb
  12109. instead of gsi_step.
  12110. (tree_ssa_eliminate_dead_code): Likewise.
  12111. * tree-ssa.c (compute_tree_rdefs): Rename from compute_tree_rdefs.
  12112. Update all users.
  12113. 2002-10-22 Diego Novillo <dnovillo@redhat.com>
  12114. * tree-dfa.c (struct dfa_stats_d): Add field size_tree_refs.
  12115. (tree_ref_size): New function.
  12116. (create_ref): Call it.
  12117. (dump_dfa_stats): Get total size from dfa_stats.size_tree_refs.
  12118. (count_tree_refs): Call tree_ref_size.
  12119. * tree-flow-inline.h (get_last_ref): New function.
  12120. (get_first_ref): New function.
  12121. * tree-flow.h (struct var_ref_d): Rename from var_ref.
  12122. (struct var_def_d): Rename from var_def.
  12123. (struct var_phi_d): Rename from var_phi.
  12124. (struct var_use_d): Rename from var_use.
  12125. (struct expr_phi_d): Rename from expr_phi.
  12126. (struct expr_use_d): Rename from expr_use.
  12127. * tree-ssa-ccp.c (tree_ssa_ccp): Call get_last_ref.
  12128. 2002-10-21 Daniel Berlin <dberlin@dberlin.org>
  12129. * timevar.def: Add TV_TREE_{PRE,CCP,DCE,CFG,SSA}} timevars.
  12130. * tree-optimize.c (optimize_function_tree): Push and pop timevars
  12131. for the tree optimizers.
  12132. 2002-10-21 Diego Novillo <dnovillo@redhat.com>
  12133. * Makefile.in (OBJS): Move tree-mudflap.o ...
  12134. (C_AND_OBJC_OBJS): ... here.
  12135. 2002-10-21 Diego Novillo <dnovillo@redhat.com>
  12136. * tree-flow-inline.h (rli_start): New function.
  12137. (rli_start_rev): New function.
  12138. (rli_start_at): New function.
  12139. (rli_after_end): New function.
  12140. (rli_step): New function.
  12141. (rli_step_rev): New function.
  12142. (rli_ref): New function.
  12143. * tree-flow.h (struct ref_list_iterator): Declare.
  12144. (FOR_REF_BETWEEN, FOR_EACH_REF, FOR_EACH_REF_REV): Replace with new
  12145. rli_* iterator functions. Update all users.
  12146. 2002-10-21 Frank Ch. Eigler <fche@redhat.com>
  12147. * tree-cfg.c (make_blocks): Ignore TRY_FINALLY_EXPR and
  12148. TRY_CATCH_EXPR.
  12149. * tree-mudflap.c (mx_register_decls): Ignore local decls
  12150. of extern variables of unknown size.
  12151. 2002-10-20 Daniel Berlin <dberlin@dberlin.org>
  12152. * tree-ssa-pre.c (repair_injury): DTRT, rather than abort.
  12153. * tree-dfa.c (ref_type_name): E_* don't have these modifier
  12154. fields, but may have the same bits set, so don't print the
  12155. modifiers on them.
  12156. * gimplify.c (create_tmp_var): New function, wraps calls to
  12157. create_tmp_var_1 with pushing/popping of right context.
  12158. All internal gimplify.c now use create_tmp_var_1.
  12159. (create_tmp_var_noc): New function, create the var without
  12160. pushing/popping, and without exposing internals of create_tmp_var_1.
  12161. Only one use of this.
  12162. * tree-simple.h (create_tmp_var_noc): New prototype.
  12163. * c-simplify.c (simplify_stmt_expr): create_tmp_var changed to
  12164. create_tmp_var_noc.
  12165. * tree-ssa-pre.c: Add WAITING_FOR_DFA_UPDATE around code waiting for DFA
  12166. functions to keep refs up to date.
  12167. (add_call_to_ei): occurs and occurstmts is now an
  12168. array of tree pointers, not trees. Update approriately.
  12169. (insert_occ_in_preorder_dt_order_1): Ditto.
  12170. (tree_perform_ssapre): Ditto.
  12171. (find_use_for_var): Removed function.
  12172. (orig_expr_map): Removed global, removed uses.
  12173. (struct ei): Added injfixups member.
  12174. (is_strred_cand): STRIP_WFL the expression.
  12175. (calculate_increment): Ditto.
  12176. (is_injuring_def): Ditto.
  12177. (defs_y_dom_x): Ditto. Also account for fact that y is now a full
  12178. expression, not just an RHS.
  12179. (defs_match_p): Ditto (t2 is no longer just an RHS).
  12180. (finalize_1): Do insertion by replacement.
  12181. (repair_injury): Clean up, do insertion by replacement.
  12182. (find_reaching_def_of_var): Do backwards search in a cleaner way.
  12183. (update_ssa_for_new_use): Change how we do replacement.
  12184. (code_motion): Insertion by replacement. Print EXPR_WFL_LINENO, not
  12185. STMT_LINENO.
  12186. (pre_part_1_trav): Just create_tmp_var will now suffice.
  12187. 2002-10-18 Diego Novillo <dnovillo@redhat.com>
  12188. * tree-dfa.c (find_refs_in_expr): Change type of second argument to
  12189. enum tree_ref_type. Add third argument ref_mod. Update all users.
  12190. (create_ref): Add third argument ref_mod. Decode bitmask to set
  12191. the individual bitfields in the new reference.
  12192. * tree-flow-inline.h (is_may_ref): New function.
  12193. (is_may_def): New function.
  12194. (is_may_use): New function.
  12195. (is_partial_ref): New function.
  12196. (is_partial_def): New function.
  12197. (is_partial_use): New function.
  12198. (is_volatile_ref): New function.
  12199. (is_volatile_def): New function.
  12200. (is_volatile_use): New function.
  12201. (is_default_def): New function.
  12202. (is_clobbering_def): New function.
  12203. (is_initializing_def): New function.
  12204. (is_relocating_def): New function.
  12205. (is_addressof_use): New function.
  12206. (is_pure_use): New function.
  12207. * tree-flow.h (V_DEF, V_USE, V_PHI, E_PHI, E_USE, E_KILL): Redefine
  12208. inside enum tree_ref_type. Update all users.
  12209. (enum tree_ref_type): Define.
  12210. (TRM_DEFAULT, TRM_CLOBBER, TRM_MAY, TRM_PARTIAL, TRM_INITIAL,
  12211. TRM_VOLATILE, TRM_RELOCATE): Rename from M_*. Update all users.
  12212. (struct tree_ref_common): Change type of field 'type' to enum
  12213. tree_ref_type. Update all users.
  12214. (struct var_ref): Add bitfields 'm_may', 'm_partial' and 'm_volatile'.
  12215. (struct var_def): Add bitfield 'm_default', 'm_clobber', 'm_initial'
  12216. and 'm_relocate'.
  12217. (struct var_use): Add bitfield 'm_addressof'.
  12218. (ref_type): Change return type to enum tree_ref_type. Update all
  12219. users.
  12220. (create_ref): Add new argument ref_mod. Update all users.
  12221. (function_may_recurse_p): Change return type to bool. Update all
  12222. users.
  12223. (ref_type_name): Change argument type to tree_ref. Update all
  12224. users.
  12225. (validate_ref_type): Remove.
  12226. 2002-10-18 Diego Novillo <dnovillo@redhat.com>
  12227. * cp/Make-lang.in (CXX_C_OBJS): Remove tree-cfg.o, tree-dfa.o,
  12228. tree-optimize.o, tree-ssa.o, tree-ssa-pre.o, gimplify.o, tree-simple.o,
  12229. tree-alias-steen.o, tree-alias-ecr.o, tree-alias-type.o,
  12230. disjoint-set.o, tree-ssa-ccp.o, tree-dchain.o, tree-alias-common.o,
  12231. and tree-ssa-dce.o.
  12232. 2002-10-17 Diego Novillo <dnovillo@redhat.com>
  12233. * Makefile.in (TREE_FLOW_H): Add bitmap.h, basic-block.h,
  12234. hard-reg-set.h and tree-simple.h. Update all users.
  12235. (C_AND_OBJC_OBJS): Move tree-cfg.o, tree-dfa.o,
  12236. tree-ssa.o, tree-optimize.o, c-simplify.o, c-call-graph.o,
  12237. tree-simple.o, simple-break-elim.o, simple-goto-elim.o, tree-dchain.o,
  12238. tree-ssa-pre.o, tree-alias-type.o, tree-mudflap.o, gimplify.o,
  12239. tree-alias-ecr.o, tree-alias-common.o, tree-alias-steen.o,
  12240. disjoint-set.o, tree-ssa-ccp.o and tree-ssa-dce.o ...
  12241. (OBJS): ... here.
  12242. (gimplify.o): Add dependency on $(TREE_FLOW_H).
  12243. (tree-pretty-print.o): New rule.
  12244. (GTFILES): Add tree-flow.h
  12245. * c-config-lang.in (gtfiles): Remove tree-flow.h
  12246. * c-simplify.c (copy_if_shared_r, unmark_visited_r,
  12247. unshare_all_trees, mark_not_simple): Move ...
  12248. * gimplify.c: ... here.
  12249. Include tree-flow.h
  12250. * tree-flow.h: Include hard-reg-set.h.
  12251. * c-common.h (print_c_tree, print_c_node, print_c_node_brief,
  12252. debug_c_tree, debug_c_node, debug_c_node_brief): Move declarations
  12253. from diagnostic.h.
  12254. * c-call-graph.c (construct_call_graph): Call get_name.
  12255. (print_callee): Likewise.
  12256. * c-pretty-print.c (print_declaration): Declare static.
  12257. (print_function_decl): Likewise.
  12258. (print_struct_decl): Likewise.
  12259. (dump_c_tree): Likewise.
  12260. (dump_c_node): Likewise.
  12261. * diagnostic.h (dump_generic_tree, dump_generic_node,
  12262. print_generic_tree, print_generic_node, print_generic_node_brief):
  12263. Declare.
  12264. * tree-pretty-print.c: New file.
  12265. * c-decl.c: Replace calls to print_c_node with print_generic_node.
  12266. * tree-alias-common.c: Likewise.
  12267. * tree-alias-steen.c: Likewise.
  12268. * tree-cfg.c: Likewise.
  12269. * tree-dfa.c: Likewise.
  12270. * tree-mudflap.c: Likewise.
  12271. * tree-optimize.c: Likewise.
  12272. * tree-ssa-ccp.c: Likewise.
  12273. * tree-ssa-pre.c: Likewise.
  12274. * tree-ssa-dce.c: Likewise.
  12275. Don't include c-common.h nor c-tree.h
  12276. (tree_ssa_eliminate_dead_code): Don't call COMPOUND_BODY.
  12277. Replace ASM_STMT with ASM_EXPR. Don't check for EXPR_STMT.
  12278. 2002-10-17 Daniel Berlin <dberlin@dberlin.org>
  12279. Diego Novillo <dnovillo@redhat.com>
  12280. * tree-cfg.c (remove_bb_ann): Remove. Update all users.
  12281. (delete_tree_cfg): Set bb->aux to NULL in all basic blocks.
  12282. * tree-dfa.c: Remove extern declaration for tree_find_refs.
  12283. (create_ref_list): Allocate new list with ggc_alloc.
  12284. (empty_ref_list): Just set first and last element to NULL.
  12285. (delete_ref_list): Remove. Update all users.
  12286. (remove_ref_from_list): Don't call free.
  12287. (add_ref_to_list_begin): Allocate new node with ggc_alloc.
  12288. (add_ref_to_list_end): Likewise.
  12289. (add_ref_to_list_after): Likewise.
  12290. (create_ref): Call BITMAP_GGC_ALLOC.
  12291. (remove_tree_ann): Remove. Update all users.
  12292. (tree_ref_structure): New function.
  12293. * tree-flow.h (edge, basic_block): Forward declare if necessary.
  12294. (struct ref_list_node): Mark for garbage collection.
  12295. (struct ref_list_priv): Likewise.
  12296. (struct tree_ref_common): Likewise.
  12297. (struct var_ref): Likewise.
  12298. (struct var_def): Likewise.
  12299. (struct var_phi): Likewise.
  12300. (struct var_use): Likewise.
  12301. (struct phi_node_arg_d): Likewise.
  12302. (struct expr_ref_common): Likewise.
  12303. (struct expr_phi): Likewise.
  12304. (struct expr_use): Likewise.
  12305. (union tree_ref_d): Likewise.
  12306. (struct tree_ann_d): Likewise.
  12307. (struct bb_ann_def): Likewise.
  12308. (referenced_vars): Likewise.
  12309. (global_var): Likewise.
  12310. (enum tree_ref_structure_enum): New.
  12311. (call_sites): Remove unused function.
  12312. * tree-inline.c (copy_tree_r): Copy the 'ann' field from tree_common.
  12313. * old-tree-inline.c (copy_tree_r): Likewise.
  12314. * tree-ssa.c (added): Mark for garbage collection.
  12315. (in_work): Likewise.
  12316. (work_stack): Likewise.
  12317. (delete_tree_ssa): Set global_var to NULL_TREE.
  12318. * tree.h (struct tree_ann_d): Forward declare.
  12319. (struct tree_common): Rename field 'aux' to 'ann'. Update all
  12320. users. Don't mark it 'skip' for garbage collection.
  12321. 2002-10-16 Daniel Berlin <dberlin@dberlin.org>
  12322. * tree-dfa.c (compute_may_aliases): Call create/delete_alias_vars
  12323. if flag_tree_points_to is on.
  12324. (may_alias_p): Use points-to info if user asked us to generate it.
  12325. * tree-optimize.c (optimize_function_tree): Don't call
  12326. create_alias_vars here.
  12327. 2002-10-16 Diego Novillo <dnovillo@redhat.com>
  12328. * tree-cfg.c (make_cond_expr_edges): If the conditional has known
  12329. value, only make the edge to the corresponding branch.
  12330. (tree_delete_bb): Write a warning to the dump file when removing
  12331. blocks with executable statements.
  12332. (first_exec_stmt): Skip over empty BIND_EXPR blocks.
  12333. * tree-dfa.c (find_refs_in_expr): Don't look for references in non
  12334. GIMPLE statements.
  12335. (remove_tree_ann): Clear the annotation with memset.
  12336. (collect_dfa_stats_r): Don't call tree_annotation.
  12337. (find_may_aliases_for): Avoid adding the same alias more than once.
  12338. (may_alias_p): Fix comment grammar.
  12339. * tree-flow-inline.h (is_exec_stmt): New function.
  12340. * tree-flow.h (FOR_EACH_REF): Guard against NULL lists.
  12341. (FOR_EACH_REF_REV): Likewise.
  12342. (is_exec_stmt): Declare.
  12343. * tree-ssa-ccp.c (visit_phi_node): Reformat debug dumping output.
  12344. (visit_expression_for): Move check for clobbering definitions
  12345. before check for NULL expressions.
  12346. (visit_condexpr_for): Reformat debug dumping output.
  12347. (set_lattice_value): Remove stale comments.
  12348. (replace_uses_in): Don't clear TF_FOLDED flag from expression.
  12349. * tree-ssa.c (add_phi_node): If possible, associate the PHI node to
  12350. a statement.
  12351. (create_default_def): Create initial declarations for static
  12352. variables with DECL_INITIAL set.
  12353. (delete_tree_ssa): Remove annotations from variables.
  12354. 2002-10-16 Daniel Berlin <dberlin@dberlin.org>
  12355. * tree-alias-type.c (alias_tvar_new_with_aterm): New function.
  12356. Update all allocations to allocate right type, rather than the union.
  12357. Update to use macros to access members of alias_typevar.
  12358. * tree-alias-type.h: Split alias_typevar into a common, an ECR, and
  12359. an aterm, update all users.
  12360. Add macros to access members of union.
  12361. * tree-alias-common.c (create_alias_var): Handle function_decl's
  12362. properly (needed for proper handling of function pointers).
  12363. Updates for macros to access typevars.
  12364. Fix some indentation.
  12365. * tree-alias-steen.c: Updates for macros to access typevars.
  12366. 2002-10-16 Frank Ch. Eigler <fche@redhat.com>
  12367. * c-decl.c (c_expand_body): Enable mudflap, only for gimple.
  12368. * c-pretty-print.c (dump_c_node): Render try/catch/finally exprs.
  12369. (op_prio): Accept BIND_EXPRs.
  12370. * gcc.c (cpp_unique_options): Make -fmudflap -include mf-runtime.h.
  12371. * toplev.c (process_options): Complain on -fmudflap -fdisable-simple.
  12372. * tree-mudflap.c (*): Reorganize for generic/gimple operation.
  12373. (mf_init_extern_trees): Extract decl nodes from -include'd file.
  12374. (mf_external_ref, mf_decl_extern_trees): Removed; updated callers.
  12375. (mf_offset_expr_of_array_ref): Don't bother store index type as
  12376. TREE_PURPOSE.
  12377. (mf_build_check_statement_for): Use GIMPLE tree types and builders.
  12378. (mx_register_decls): New function, replacing mx_register_decl.
  12379. (mx_xfn_xform_decls): Support only GIMPLE input tree types.
  12380. (mf_flush_enqueued_calls): Clean up enqueued call statements.
  12381. 2002-10-14 Diego Novillo <dnovillo@redhat.com>
  12382. * toplev.c (parse_options_and_default_flags): Undo local
  12383. hack that slipped in the previous commit.
  12384. 2002-10-14 Diego Novillo <dnovillo@redhat.com>
  12385. * Makefile.in (c-decl.o): Add dependency on diagnostic.h.
  12386. * c-decl.c: Include diagnostic.h
  12387. (c_expand_body): Call get_name.
  12388. * basic-block.h (struct basic_block_def): Rename head_tree to
  12389. head_tree_p and end_tree to end_tree_p. Change type to tree *.
  12390. Update all users.
  12391. (BLOCK_HEAD_TREE): Remove. Update all users.
  12392. (BLOCK_END_TREE): Remove. Update all users.
  12393. * tree-cfg.c (build_tree_cfg): Return if function body is empty.
  12394. (make_blocks): Change first argument to tree *. Update all users.
  12395. (make_bind_expr_blocks): Likewise.
  12396. (make_loop_expr_blocks): Likewise.
  12397. (make_cond_expr_blocks): Likewise.
  12398. (make_switch_expr_blocks): Likewise.
  12399. (create_bb): Likewise.
  12400. (first_exec_block): Likewise.
  12401. (first_exec_stmt): Likewise.
  12402. (tree_delete_bb): Use a gimple statement iterator to unmap
  12403. statements.
  12404. (insert_stmt_before): Remove empty function.
  12405. (replace_expr_in_tree): Remove. Update all users.
  12406. (find_expr_in_tree_helper): Likewise.
  12407. (find_expr_in_tree): Likewise.
  12408. (first_stmt): Call STRIP_NOPS.
  12409. (last_stmt): Call STRIP_NOPS.
  12410. * tree-dfa.c (struct clobber_data_d): Rename parent_stmt to
  12411. parent_stmt_p and parent_expr to parent_expr_p. Change types to
  12412. tree *. Update all users.
  12413. (find_refs_in_stmt): Change first argument type to tree *. Update
  12414. all users.
  12415. (find_refs_in_expr): Chnage arguments parent_stmt and parent_expr
  12416. to tree *. Update all users.
  12417. (create_ref): Don't add the same reference twice on the same list
  12418. when parent_stmt and parent_expr are the same node.
  12419. Don't set output_ref when the parent statement is not in GIMPLE
  12420. form.
  12421. (replace_ref_operand_with): Move from tree-flow-inline.h
  12422. (replace_ref_expr_with): New function.
  12423. (replace_ref_stmt_with): New function.
  12424. (create_tree_ann): Abort if trying to annotate certain nodes.
  12425. Don't create an empty ref list.
  12426. In the presence of WFL or NOPS wrappers, add the annotation to the
  12427. inner node.
  12428. (dump_ref): Don't call tree_annotation to access the tree
  12429. annotation.
  12430. * tree-flow.h (struct tree_ref_common): Rename field stmt to stmt_p
  12431. and field expr to expr_p. Change types to tree *. Update all
  12432. users.
  12433. (replace_ref_expr_with): Declare.
  12434. (replace_ref_stmt_with): Declare.
  12435. (insert_stmt_before, insert_stmt_after, replace_expr_in_tree,
  12436. find_expr_in_tree): Remove.
  12437. * tree-flow-inline.h (ref_expr): Return NULL_TREE if expr_p is
  12438. NULL.
  12439. (ref_stmt): Return NULL_TREE if stmt_p is NULL.
  12440. (tree_annotation): Call STRIP_WFL and STRIP_NOPS before returning
  12441. the annotation.
  12442. (add_tree_ref): Remove consistency checks. Create an empty list
  12443. the first time.
  12444. (get_lineno): Return -1 on NULL_TREE.
  12445. (set_output_ref): Remove consistency.
  12446. (set_tree_flag): Likewise.
  12447. (clear_tree_flag): Likewise.
  12448. (reset_tree_flags): Likewise.
  12449. * tree-simple.h (gimple_stmt_iterator): Rename ptr to tp. Change
  12450. type to tree *. Update all users.
  12451. (gsi_start): Change argument type to tree *. Update all users.
  12452. (gsi_stmt_ptr): New function.
  12453. (gsi_container): New function.
  12454. * tree-optimize.c (optimize_function_tree): Don't test fnbody for
  12455. NULL.
  12456. Re-enable optimizers.
  12457. * tree-ssa-ccp.c: Update documentation comments.
  12458. Don't include c-common.h and c-tree.h.
  12459. (tree_ssa_ccp): Don't call COMPOUND_BODY.
  12460. (ccp_fold): New private function.
  12461. (substitute_and_fold): Call it.
  12462. Call replace_ref_expr_with.
  12463. Set TF_FOLDED flag on the statement, not the expression.
  12464. (visit_assignment_for): Call STRIP_NOPS and STRIP_WFL.
  12465. (evaluate_expr): Call ccp_fold. Only use the RHS of the simplified
  12466. value in the case of MODIFY_EXPR or INIT_EXPR.
  12467. (restore_expr):
  12468. * tree-ssa-dce.c (mark_control_parent_necessary): Use a gimple
  12469. iterator.
  12470. (tree_ssa_eliminate_dead_code): Likewise.
  12471. * tree-ssa-pre.c: Disable and add warning comments for out-of-date
  12472. calls to create_ref, find_refs_in_stmt and replace_expr_in_tree.
  12473. 2002-10-12 Daniel Berlin <dberlin@dberlin.org>
  12474. * tree-alias-type.h (alias_typevar_def): Add struct aterm
  12475. as a temporary hack for andersen's analysis.
  12476. * tree-alias-common.c (current_alias_ops): New, use it
  12477. instead of referring to steen_alias_ops everywhere.
  12478. (get_alias_var): Use STRIP_WFL.
  12479. (find_func_aliases): Ditto.
  12480. (create_alias_vars): Call init function, move deletion to
  12481. delete_alias_vars.
  12482. (delete_alias_vars): New function, move deletion code to here.
  12483. (get_virtual_var): Removed.
  12484. (ptr_may_alias_var): New function.
  12485. * tree-alias-common.h (struct tree_alias_ops): Add may_alias
  12486. function.
  12487. * tree-alias-steen.c (steen_may_alias): New function.
  12488. 2002-10-10 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
  12489. * diagnostic.h (dump_c_tree, dump_c_node,
  12490. print_declaration, print_function_decl,
  12491. print_struct_decl): Fix argument types.
  12492. 2002-10-10 Diego Novillo <dnovillo@redhat.com>
  12493. * tree.h (struct tree_common): Rename field unused_0 to
  12494. not_gimple_flag.
  12495. (TREE_NOT_GIMPLE): Define.
  12496. * c-simplify.c (mark_not_simple_r): Remove. Update all users.
  12497. (mark_not_simple): Set TREE_NOT_GIMPLE.
  12498. * gimplify.c (simplify_call_expr): Enable call to mark_not_simple.
  12499. * tree-flow.h (TF_NOT_SIMPLE): Remove. Update all users.
  12500. * tree-cfg.c (build_tree_cfg): Rename from tree_find_basic_blocks.
  12501. Update all users.
  12502. Find the first executable statement before starting basic block 0.
  12503. (make_blocks): Do not accept TRY_FINALLY_EXPR and TRY_CATCH_EXPR
  12504. nodes.
  12505. (make_edges): Always create an edge from entry to basic block 0.
  12506. (delete_tree_cfg): Rename from delete_cfg. Update all uses.
  12507. (first_exec_stmt): Return the container for the first statement,
  12508. not the statement itself.
  12509. * tree-dfa.c (tree_find_refs): Re-implement using a GIMPLE
  12510. iterator.
  12511. (find_refs_in_stmt): Handle GIMPLE statements.
  12512. (find_refs_in_expr): Call flags_from_decl_or_type when handling
  12513. CALL_EXPR expressions.
  12514. (create_ref): Call DECL_P.
  12515. (remove_tree_ann): Call tree_annotation.
  12516. * tree-flow-inline.h (gsi_step_bb): Stop if statement is not inside
  12517. a basic block.
  12518. * tree-flow.h (build_tree_cfg): Rename from tree_find_basic_blocks.
  12519. Update all users.
  12520. (delete_tree_cfg): Rename from delete_cfg.
  12521. (tree_find_refs): Declare.
  12522. (build_tree_ssa): Rename from tree_build_ssa.
  12523. (is_upward_exposed): Remove unused function.
  12524. * tree-optimize.c (delete_tree_ssa): Remove declaration.
  12525. (optimize_function_tree): Re-enable SSA builder.
  12526. * tree-simple.h (gsi_container): New function.
  12527. * Makefile.in (tree-ssa.o): Remove dependencies on c-common.h and
  12528. c-tree.h.
  12529. * tree-ssa.c: Don't include c-common.h nor c-tree.h.
  12530. (tree_find_refs): Remove declaration.
  12531. (remove_annotations_r): New local function.
  12532. (build_tree_ssa): Rename from tree_build_ssa. Update all users.
  12533. (analyze_rdefs): Don't call prep_stmt.
  12534. (is_upward_exposed): Remove unused function.
  12535. (add_phi_node): Don't associate the PHI node to a statement.
  12536. (delete_tree_ssa): Receive the function body as argument.
  12537. Walk the function body removing annotations from every tree.
  12538. 2002-10-10 Steven Bosscher <s.bosscher@student.tudelft.nl>
  12539. * tree-ssa-dce (tree_ssa_eliminate_dead_code): Initialize prev to
  12540. NULL_TREE.
  12541. Don't close dump_file until end of function.
  12542. Dump the tree after DCE for -fdump-tree-dce.
  12543. 2002-10-08 Richard Henderson <rth@redhat.com>
  12544. Jason Merrill <jason@redhat.com>
  12545. Diego Novillo <dnovillo@redhat.com>
  12546. * tree-simple.h (gimple_stmt_iterator): New type.
  12547. (gsi_start): New function.
  12548. (gsi_after_end): New function.
  12549. (gsi_step): New function.
  12550. (gsi_stmt): New function.
  12551. 2002-10-08 Diego Novillo <dnovillo@redhat.com>
  12552. * calls.c (flags_from_decl_or_type): Make extern.
  12553. (ECF_*): Move ...
  12554. * rtl.h (ECF_*): ... here.
  12555. (flags_from_decl_or_type): Declare.
  12556. * tree.h (COND_EXPR_COND): Define.
  12557. (COND_EXPR_THEN): Define.
  12558. (COND_EXPR_ELSE): Define.
  12559. (LABEL_EXPR_LABEL): Define.
  12560. (optimize_function_tree): Declare.
  12561. 2002-10-08 Diego Novillo <dnovillo@redhat.com>
  12562. * Makefile.in (TREE_FLOW_H): Define.
  12563. (c-decl.o): Remove dependency on tree-optimize.h.
  12564. (tree-alias-steen.o, tree-alias-common.o, tree-ssa.o, tree-ssa-pre.o,
  12565. tree-cfg.o, tree-dfa.o, tree-optimize.o, c-simplify.o, c-call-graph.o,
  12566. tree-ssa-dce.o, tree-ssa-ccp.o): Depend on $(TREE_FLOW_H).
  12567. (tree-cfg.o): Remove dependencies on c-tree.h and c-common.h.
  12568. * c-call-graph.c (construct_call_graph): Disable calls to removed
  12569. functions.
  12570. * c-decl.c: Don't include tree-optimize.h.
  12571. (c_expand_body): Enable calls to optimize_function_tree.
  12572. * c-pretty-print.c (dump_c_node): Fix printf warnings.
  12573. Only dump the first node of a COMPOUND_EXPR when brief_dump is set.
  12574. Use COND_EXPR_COND, COND_EXPR_THEN and COND_EXPR_ELSE accessors.
  12575. Only dump the opening brace of a BIND_EXPR when brief_dump is set.
  12576. * tree-cfg.c: Don't include tree-optimize.h, c-common.h and c-tree.h.
  12577. (binding_stack, make_for_stmt_blocks, make_if_stmt_blocks,
  12578. make_while_stmt_blocks, make_switch_stmt_blocks,
  12579. make_do_stmt_blocks, create_maximal_bb, make_for_stmt_edges,
  12580. make_while_stmt_edges, make_do_stmt_edges, make_if_stmt_edges,
  12581. make_break_stmt_edges, make_continue_stmt_edges, create_loop_hdr,
  12582. insert_before_ctrl_stmt, insert_before_normal_stmt,
  12583. insert_after_ctrl_stmt, insert_after_normal_stmt,
  12584. insert_after_loop_body, tree_split_bb, stmt_ends_bb_p): Remove.
  12585. Update all users.
  12586. (STRIP_CONTAINERS): Define.
  12587. (make_bind_expr_blocks): New local function.
  12588. (make_cond_expr_blocks): New local function.
  12589. (make_loop_expr_blocks): New local function.
  12590. (make_switch_expr_blocks): New local function.
  12591. (make_loop_expr_edges): New local function.
  12592. (make_cond_expr_edges): New local function.
  12593. (make_case_label_edges): New local function.
  12594. (first_exec_block): New local function.
  12595. (make_goto_expr_edges): Rename from make_goto_stmt_edges.
  12596. (make_blocks): Remove arguments COMPOUND_STMT and PREV_CHAIN_P.
  12597. Use gimple_stmt_iterator to iterate over the statements in the
  12598. function. Create maximal basic blocks during traversal.
  12599. (create_bb): Remove arguments end, prev_chain_p and binding_scope.
  12600. Rename control_parent to parent_block.
  12601. (set_bb_for_stmt): Move from tree-flow.h.
  12602. (make_edges): Don't assume that basic block 0 contains executable
  12603. statements.
  12604. Handle BIND_EXPR nodes.
  12605. (make_ctrl_stmt_edges): Handle LOOP_EXPR, COND_EXPR and
  12606. SWITCH_EXPR.
  12607. (make_exit_edges): Handle GOTO_EXPR, CALL_EXPR and RETURN_EXPR.
  12608. (tree_delete_bb): Call first_stmt and last_stmt.
  12609. (block_invalidates_loop): Call last_stmt.
  12610. (replace_expr_in_tree): Don't dump line number information.
  12611. (find_expr_in_tree_helper): Don't call statement_code_p.
  12612. (tree_dump_bb): Call get_lineno.
  12613. (tree_cfg2dot): Ditto.
  12614. (successor_block): Use a gimple_stmt_iterator to find the first
  12615. executable block after the current one.
  12616. (is_ctrl_stmt): Handle COND_EXPR, LOOP_EXPR and SWITCH_EXPR.
  12617. (is_ctrl_altering_stmt): Call flags_from_decl_or_type to discover
  12618. non-return functions.
  12619. (is_loop_stmt): Handle LOOP_EXPR.
  12620. (is_computed_goto): Handle GOTO_EXPR.
  12621. (stmt_starts_bb_p): Handle CASE_LABEL_EXPR, LABEL_EXPR, RETURN_EXPR
  12622. and BIND_EXPR.
  12623. (first_exec_stmt): Use a gimple_stmt_iterator to traverse the
  12624. statements.
  12625. (first_stmt): New function.
  12626. (last_stmt): New function.
  12627. * tree-dfa.c: Don't include c-common.h, c-tree.h and
  12628. tree-optimize.h. Include diagnostic.h.
  12629. (tree_find_refs): Disable.
  12630. (find_refs_in_stmt): Disable.
  12631. (find_refs_in_expr): Don't call prep_stmt.
  12632. (tree_ann): Don't annotate empty_stmt_node.
  12633. (find_declaration): Remove. Update all users.
  12634. (dump_ref): Call get_lineno.
  12635. (is_visible_to): Always return true.
  12636. * tree-flow.h: Include tree-flow-inline.h, basic-block.h and
  12637. tree-simple.h.
  12638. (tree_ann_d): Remove compound_parent field.
  12639. (set_bb_for_stmt): Declare extern.
  12640. (compound_parent, set_compound_parent, struct for_header_blocks,
  12641. union header_blocks, prev_chain_p, set_prev_chain_p, binding_scope,
  12642. set_binding_scope, loop_hdr, for_init_bb, set_for_init_bb,
  12643. for_cond_bb, set_for_cond_bb, for_expr_bb, set_for_expr_bb,
  12644. end_while_bb, set_end_while_bb, do_cond_bb, set_cond_bb,
  12645. stmt_ends_bb_p, loop_parent, latch_block, switch_parent,
  12646. first_exec_stmt, last_exec_stmt, is_exec_stmt,
  12647. is_statement_expression, first_non_decl_stmt, first_decl_stmt,
  12648. first_non_label_in_bb, tree_split_bb, find_declaration): Remove.
  12649. Update all users.
  12650. (get_lineno): New function.
  12651. (struct bb_ann_def): Rename field parent to parent_block. Update
  12652. all users.
  12653. Remove fields prev_chain_p, loop_hdr and binding_scope. Update all
  12654. users.
  12655. (parent_block): Rename from bb_parent.
  12656. (set_parent_block): Rename from set_bb_parent.
  12657. (prev_chain_p): Remove
  12658. (bb_empty_p): Return true if block only contains empty_stmt_node.
  12659. (gsi_step_bb): New function.
  12660. (gsi_start_bb): New function.
  12661. (gsi_insert_before, gsi_insert_after, gsi_delete, gsi_replace):
  12662. Declare.
  12663. (insert_stmt_before): Rename from insert_stmt_tree_before.
  12664. (insert_stmt_after): Rename from insert_stmt_tree_after.
  12665. (first_stmt): Declare.
  12666. (last_stmt): Declare.
  12667. (tree_perform_ssapre, tree_ssa_ccp,
  12668. tree_ssa_eliminate_dead_code): Move declaration from tree-optimize.h.
  12669. * tree-flow-inline.h: New file for all the inline functions
  12670. declared in tree-flow.h
  12671. * tree-optimize.c: Don't include tree-optimize.h, c-common.h and
  12672. c-tree.h.
  12673. (optimize_function_tree): Disable call to double_chain_stmts.
  12674. Call init_flow.
  12675. Call tree_find_basic_blocks.
  12676. Disable calls to tree_build_ssa and optimizers.
  12677. (build_tree_ssa): Remove. Update all users.
  12678. * tree-optimize.h: Remove.
  12679. * tree-ssa-ccp.c: Don't include tree-optimize.h
  12680. * tree-ssa-dce.c: Don't include tree-optimize.h.
  12681. Include diagnostic.h
  12682. * tree-ssa-pre.c: Don't include tree-optimize.h.
  12683. (requires_edge_placement): Disable unused function.
  12684. (set_need_repair): Disable unused function.
  12685. (finalize_1): Disable calls to insert_stmt_tree_before and
  12686. insert_stmt_tree_after.
  12687. (repair_injury): Ditto.
  12688. (code_motion): Ditto.
  12689. * tree-ssa.c: Don't include tree-optimize.h.
  12690. (insert_phi_nodes_for): Remove unused variable.
  12691. (add_phi_node): Don't call statement_code_p.
  12692. * cp/optimize.c: Don't include tree-optimize.h
  12693. * tree-alias-common.c: Don't include tree-optimize.h.
  12694. (find_func_decls): Disable.
  12695. (display_points_to_set): Disable.
  12696. * tree-alias-steen.c: Don't include tree-optimize.h.
  12697. 2002-10-04 Jason Merrill <jason@redhat.com>
  12698. * gimplify.c (declare_tmp_vars): Don't add temps to block vars.
  12699. * tree-inline.c (remap_decls): Split out from remap_block.
  12700. (copy_bind_expr): Remap BIND_EXPR_VARS separately from block vars.
  12701. * c-simplify.c (simplify_expr_stmt): Call set_file_and_line_for_stmt.
  12702. * gimplify.c: New file.
  12703. (push_gimplify_context, pop_gimplify_context): New fns.
  12704. (gimple_push_bind_expr, gimple_pop_bind_expr): New fns.
  12705. (simplify_bind_expr): Use them.
  12706. (gimple_current_bind_expr, gimple_add_tmp_var): New fn.
  12707. (foreach_stmt): Recurse if necessary.
  12708. (various): Use generic interfaces instead of c-specific ones.
  12709. * c-simplify.c: Move language-independent code to gimplify.c.
  12710. (simplify_c_loop): Use add_tree instead of add_stmt_to_compound.
  12711. (various): Use new *_bind_expr interfaces.
  12712. * Makefile.in (C_AND_OBJC_OBJS): Add gimplify.o.
  12713. (gimplify.o): New rule.
  12714. * c-decl.c (c_expand_body): Dump trees here.
  12715. * c-simplify.c (simplify_function_body): Not here.
  12716. 2002-10-03 Frank Ch. Eigler <fche@redhat.com>
  12717. * tree-mudflap.c (mf_offset_expr_of_array_ref): Don't emit
  12718. intermediate variables for constant index values.
  12719. (mx_xfn_indirect_ref): For constant valid index values and
  12720. known valid array sizes, omit bounds checks.
  12721. 2002-10-03 Jason Merrill <jason@ariel.home>
  12722. * c-simplify.c (simplify_bind_expr): Don't clear TREE_SIDE_EFFECTS
  12723. if we have a block.
  12724. * c-simplify.c (simplify_expr) [TRY_FINALLY_EXPR]: New case.
  12725. * tree-inline.c (copy_body_r) [RETURN_EXPR]: Don't make an extra
  12726. copy of the MODIFY_EXPR. Mark the return label used.
  12727. (expand_call_inline): Don't push/pop_srcloc. Only emit the return
  12728. label if it was used.
  12729. * tree-simple.c (right_assocify_expr): Split out from
  12730. rationalize_compound_expr. Don't move non-matching op0's.
  12731. * tree-simple.h: Declare it.
  12732. * c-simplify.c (simplify_boolean_expr): Call it.
  12733. (simplify_cond_expr): Reorganize. Optimize if (a&&b).
  12734. * c-simplify.c (wrap_with_wfl): Drop special loop handling.
  12735. (simplify_c_loop): Wrap loop contents in wfls.
  12736. * c-simplify.c (STRIP_WFL): Move...
  12737. * tree.h: ...here.
  12738. * c-common.c (c_walk_subtrees): Don't walk TREE_CHAIN.
  12739. * tree-inline.c (walk_tree): Call langhook walk_subtrees first.
  12740. For expressions, walk TREE_CHAIN if it matters.
  12741. 2002-10-01 Frank Ch. Eigler <fche@redhat.com>
  12742. * builtins.c (expand_builtin_alloca): Disable if -fmudflap.
  12743. * tree-mudflap.c (mudflap_enqueue_decl): Tweak logic to include
  12744. more globals.
  12745. (mx_xfn_indirect_ref): Handle bitfield COMPONENT_REFs; instrument
  12746. BIT_FIELD_REF/INDIRECT_REFs.
  12747. 2002-10-01 Jason Merrill <jason@redhat.com>
  12748. * c-decl.c (poplevel): Only add undeclared labels to the toplevel
  12749. block.
  12750. * c-parse.in (label_decl): Push the declared label.
  12751. * c-decl.c (c_expand_body): If we've been simplified, use
  12752. expand_expr_stmt_value instead.
  12753. * c-decl.c (c_expand_decl): Rename from c_expand_decl_stmt.
  12754. Handle all C-specific expansion semantics.
  12755. * c-tree.h: Change prototype.
  12756. * langhooks.h (struct lang_hooks): Add expand_decl hook.
  12757. * langhooks.c (lhd_expand_decl): Default version.
  12758. * langhooks-def.h (LANG_HOOKS_EXPAND_DECL): Provide default.
  12759. * c-lang.c (LANG_HOOKS_EXPAND_DECL): Define.
  12760. * c-semantics.c (lang_expand_decl_stmt): Remove.
  12761. (genrtl_decl_stmt): Use lang_hooks.expand_decl.
  12762. * Makefile.in (c-semantics.o): Depend on langhooks.h.
  12763. * c-objc-common.c (c_objc_common_init): Don't set
  12764. lang_expand_decl_stmt.
  12765. * c-common.def (ASM_STMT): Only 4 operands.
  12766. * c-common.h (ASM_CV_QUAL): Remove.
  12767. (genrtl_asm_stmt): Adjust prototype.
  12768. * c-typeck.c (build_asm_stmt): Adjust.
  12769. * c-semantics.c (genrtl_asm_stmt): Change cv_qualifier parm to
  12770. volatile_p.
  12771. (expand_stmt): Adjust.
  12772. * c-common.h (SWITCH_COND, SWITCH_BODY, CASE_LOW, CASE_HIGH,
  12773. CASE_LABEL_DECL, GOTO_DESTINATION, ASM_STRING, ASM_OUTPUTS,
  12774. ASM_INPUTS, ASM_CLOBBERS, ASM_VOLATILE_P, ASM_INPUT_P): Move to tree.h.
  12775. * c-pretty-print.c (newline_and_indent): New fn.
  12776. (dump_c_tree, dump_c_node): Make spc a plain int.
  12777. (dump_c_node): Use output_add_identifier.
  12778. Reorganize for bnw-simple; indent in the enclosing node rather
  12779. than the subexpression.
  12780. [FUNCTION_DECL]: Just print the name for now.
  12781. [COMPOUND_EXPR, COND_EXPR]: Handle use as statements.
  12782. [BIND_EXPR, GOTO_EXPR, EXIT_EXPR, LOOP_EXPR, LABELED_BLOCK_EXPR,
  12783. EXIT_BLOCK_EXPR, RETURN_EXPR, SWITCH_EXPR, ASM_EXPR,
  12784. CASE_LABEL_EXPR]: Implement.
  12785. (print_declaration): Print 'static'.
  12786. * c-tree.h: Move c-pretty-print decls to diagnostic.h.
  12787. * expr.c (store_field): Don't always pass want_value==0 to store_expr.
  12788. * expr.c (expand_expr) [EXIT_EXPR]: Handle EXIT_EXPR_IS_LOOP_COND.
  12789. * expr.c (expand_expr) [LOOP_EXPR]: Pass exit_flag==0 to
  12790. exand_start_loop.
  12791. [BIND_EXPR]: Adjust for functions-as-trees mode.
  12792. [COMPOUND_EXPR]: Avoid recursion if possible.
  12793. [SWITCH_EXPR, LABEL_EXPR]: Move handling from java/expr.c.
  12794. [CASE_LABEL_EXPR, ASM_EXPR]: New handling.
  12795. * tree.h (struct tree_common): Add visited flag.
  12796. (TREE_VISITED): New macro.
  12797. * tree.c (copy_node): Clear TREE_VISITED.
  12798. * print-tree.c (print_node): Print visted.
  12799. * stmt.c (expand_asm_expr): New fn.
  12800. * tree.c (build1): Always set TREE_SIDE_EFFECTS for 's' codes.
  12801. * tree.h (enum tree_index): Add TI_EMPTY_STMT.
  12802. (empty_stmt_node): New macro.
  12803. * tree.c (build_common_tree_nodes_2): Initialize it.
  12804. * tree.def: Change some codes from 'e' to 's'.
  12805. (CASE_LABEL_EXPR, ASM_EXPR): New codes.
  12806. * tree.def (SWITCH_EXPR): Now has three operands.
  12807. * tree-inline.c: Retarget to generic trees. FIXME FIXME.
  12808. * old-tree-inline.c: Old C/Java-specific inliner.
  12809. * Makefile.in (old-tree-inline.o): New rule.
  12810. * c-common.c (c_walk_subtrees): New fn.
  12811. (c_tree_chain_matters_p): New fn.
  12812. * c-lang.c: Use them for LANG_HOOKS_TREE_INLINING_WALK_SUBTREES
  12813. and LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P.
  12814. * c-common.h: Declare them.
  12815. (DECL_NUM_STMTS): Move to tree.h.
  12816. * c-decl.c (finish_function): Simplify the function trees.
  12817. * c-objc-common.c (inline_forbidden_p): Look inside BIND_EXPRs
  12818. for nested functions. Don't inline a function with _STMT trees.
  12819. * basic-block.h: Include hard-reg-set.h.
  12820. * c-decl.c (start_function): Don't call make_decl_rtl.
  12821. (c_expand_body): Call it here instead.
  12822. * Makefile.in (explow.o): Depend on langhooks.h.
  12823. * unroll.c (copy_loop_body): Don't copy NOTE_INSN_DELETED_LABELs
  12824. between copy_notes_from and loop_end, either.
  12825. 2002-09-30 Daniel Berlin <dberlin@dberlin.org>
  12826. * tree-ssa-pre.c (repair_injury): Start work on updating SSA
  12827. representation for strength reduction injuries.
  12828. Print a new line after outputting tree node in debug statements.
  12829. Fix strength reduction of a candidate with two variables (IE a *
  12830. c).
  12831. Put the repair after the injuring statement, not at the end of the
  12832. block.
  12833. Break the RHS use lookup if it's defined by a phi.
  12834. (calculate_increment): Ditto on node printing.
  12835. (code_motion): Ditto on updating SSA rep for strength reduction
  12836. injuries.
  12837. (find_rhs_use_for_var): Rewrite to use maybe_find_rhs_use_for_var.
  12838. (maybe_find_rhs_use_for_var): Rename from find_rhs_use_for_var,
  12839. don't abort, return NULL.
  12840. (set_var_phis): Simplify break condition.
  12841. Make sure RHS *has* a use before we go and get it.
  12842. (rename2): Ditto on RHS checking.
  12843. When looking up injuring defs, break on phis.
  12844. (phi_opnd_from_res): Ditto.
  12845. (defs_y_dom_x): Ditto.
  12846. (TODO List): Add new TODO to fix the remapping crud.
  12847. 2002-09-27 Daniel Berlin <dberlin@dberlin.org>
  12848. * tree-ssa-pre.c (tree_perform_ssapre): Move insertion into
  12849. splay tree inside the is_simple_modify_expr block, to prevent
  12850. tree check failure.
  12851. 2002-09-26 Daniel Berlin <dberlin@dberlin.org>
  12852. * tree-ssa-pre.c (update_phis_in_list): New function.
  12853. (update_ssa_for_new_use): New function.
  12854. (code_motion): Start working on code to update SSA representation.
  12855. (find_reaching_def_of_var): New function.
  12856. 2002-09-25 Steven Bosscher <s.bosscher@student.tudelft.nl>
  12857. * Makefile.in (tree): Add dependency on c-tree.h
  12858. * tree-optimize.c: Include c-tree.h
  12859. (optimize_function_tree): React to -fdump-tree-optimized.
  12860. 2002-09-25 Daniel Berlin <dberlin@dberlin.org>
  12861. * tree-dfa.c (add_list_to_ref_list_end): New function.
  12862. (add_list_to_ref_list_begin): Ditto.
  12863. (find_list_node): Handle searching in empty lists.
  12864. (find_refs_in_stmt): De-staticify.
  12865. * tree-flow.h (add_list_to_ref_list_end): New declaration.
  12866. (add_list_to_ref_list_begin): Ditto.
  12867. (find_refs_in_stmt): Add prototype.
  12868. 2002-09-25 Diego Novillo <dnovillo@redhat.com>
  12869. * Makefile.in (tree-dfa.o): Depend on flags.h
  12870. * tree-cfg.c (tree_dump_cfg): Alter output format slightly.
  12871. (block_invalidates_loop): Look for clobbering definitions of
  12872. GLOBAL_VARIABLE.
  12873. * tree-simple.c (get_base_symbol): Handle EXPR_WITH_FILE_LOCATION
  12874. nodes.
  12875. * tree-optimize.c (init_tree_flow): Remove. Update all users.
  12876. (build_tree_ssa): Don't call tree_find_refs.
  12877. Don't call tree_compute_rdefs.
  12878. * tree-dfa.c: Include flags.h
  12879. (dump_file): Remove.
  12880. (dump_flags): Remove.
  12881. (pointer_refs): Remove.
  12882. (struct dfa_stats_d): Add fields max_num_phi_args, num_may_alias,
  12883. max_num_may_alias, num_alias_imm_rdefs and max_num_alias_imm_rdefs.
  12884. Remove field num_fcalls.
  12885. (dfa_counts): Declare.
  12886. (tree_find_refs): Declare.
  12887. (tree_ssa_dump_file): Declare.
  12888. (tree_ssa_dump_flags): Declare.
  12889. (dump_if_different): New function.
  12890. (add_default_defs): Remove. Update all users.
  12891. (add_call_site_clobbers): Remove. Update all users.
  12892. (add_ptr_may_refs): Remove. Update all users.
  12893. (compute_may_aliases): New function.
  12894. (find_may_aliases_for): New function.
  12895. (add_may_alias): New function.
  12896. (may_alias_p): New function.
  12897. (is_visible_to): New function.
  12898. (get_alias_index): New function.
  12899. (call_sites): Remove. Update all users.
  12900. (global_var): Declare.
  12901. (E_FCALL): Remove. Adjust other constants.
  12902. (M_INDIRECT): Remove. Update all users.
  12903. (M_RELOCATE): Declare.
  12904. (tree_find_refs): Move debugging dumps to tree_build_ssa.
  12905. Move initialization code to init_tree_ssa.
  12906. Call compute_may_aliases.
  12907. (find_refs_in_expr): For INDIRECT_REF nodes create a reference to
  12908. the canonical INDIRECT_REF node associated with the pointer symbol.
  12909. Given a pointer p, clobber the canonical INDIRECT_REF of p after
  12910. creating a V_DEF for p.
  12911. For CALL_EXPR nodes, if the called function is not pure nor
  12912. const, create a use and a clobbering definition to GLOBAL_VAR.
  12913. (create_ref): Allow INDIRECT_REF variables.
  12914. (add_phi_arg): Keep track of number of PHI arguments created.
  12915. (function_may_recurse_p): Look for clobbering definitions to
  12916. GLOBAL_VAR.
  12917. (get_fcalls): Remove unused function.
  12918. (is_pure_fcall): Remove unused function.
  12919. (fcall_takes_ref_args): Remove unused function.
  12920. (find_declaration): Stop iterating at ENTRY_BLOCK_PTR.
  12921. (debug_variable): New function.
  12922. (dump_variable): New function.
  12923. (dump_referenced_vars): Call it.
  12924. (dump_phi_args): Don't dump NULL arguments.
  12925. (PERCENT): Define.
  12926. (dump_dfa_stats): Re-format output.
  12927. Add new counters.
  12928. Call dump_if_different.
  12929. (collect_dfa_stats): Also recurse into GLOBAL_VAR.
  12930. (collect_dfa_stats_r): Collect may-alias information.
  12931. (count_tree_refs): Collect information about def-def links for
  12932. aliases.
  12933. Keep track of maximum values for number of PHI arguments, aliases
  12934. and def-def links.
  12935. (ref_type_name): Handle M_RELOCATE.
  12936. (validate_ref_type): Ditto.
  12937. * tree-ssa.c: Add more documentation.
  12938. (tree_ssa_dump_file): Rename from dump_file. Declare extern.
  12939. (tree_ssa_dump_flags): Rename from dump_flags. Declare extern.
  12940. (added): New local varray.
  12941. (in_work): New local varray.
  12942. (work_stack): New local varray.
  12943. (dfa_counts): Declare.
  12944. (insert_phi_nodes_for): New local function.
  12945. (add_phi_node): New local function.
  12946. (set_ssa_links): New local function.
  12947. (set_alias_imm_reaching_def): New local function.
  12948. (create_default_def): New local function.
  12949. (init_tree_ssa): New local function.
  12950. (tree_find_refs): Relocate declaration from tree-flow.h
  12951. (tree_build_ssa): Call init_tree_ssa.
  12952. Call tree_find_refs.
  12953. Process all SSA-related dump options.
  12954. (insert_phi_nodes): Rename from insert_phi_terms. Update all
  12955. users.
  12956. Call insert_phi_nodes_for.
  12957. (build_fud_chains): Add more documentation.
  12958. Initialize save_chain to 0.
  12959. (search_fud_chains): Add more documentation.
  12960. Call set_ssa_links.
  12961. Call create_default_def.
  12962. (tree_compute_rdefs): Initialize array marked to 0.
  12963. (follow_chain): Follow def-def chains for non-killing definitions
  12964. for aliases.
  12965. (dump_reaching_defs): Call dump_variable.
  12966. * tree-flow.h (E_FCALL): Remove. Update all users.
  12967. (M_INDIRECT): Remove. Update all users.
  12968. (M_RELOCATE): Declare.
  12969. (struct var_ref): Add field alias_imm_rdefs.
  12970. (alias_imm_reaching_def): New inline function.
  12971. (struct tree_ann_d): Add field indirect_var.
  12972. Add field may_aliases.
  12973. (enum tree_flags): Relocate.
  12974. (indirect_var): New inline function.
  12975. (set_indirect_var): New inline function.
  12976. (may_alias): New inline function.
  12977. (num_may_alias): New inline function.
  12978. (struct dfa_counts_d): Declare.
  12979. (global_var): Declare.
  12980. (FCALL_NON_PURE, FCALL_PURE, FCALL_BUILT_IN): Remove.
  12981. (tree_find_refs): Move to tree-ssa.c.
  12982. (dump_variable): Declare.
  12983. (debug_variable): Declare.
  12984. (get_fcalls): Remove.
  12985. (is_pure_fcall): Remove.
  12986. (fcall_takes_ref_args): Remove.
  12987. (ref_defines): Declare.
  12988. (is_killing_def): Declare.
  12989. (get_alias_index): Declare.
  12990. (delete_tree_ssa): Rename from delete_ssa. Update all users.
  12991. (set_currdef_for): Allow INDIRECT_REF nodes.
  12992. (bb_annotation): Don't create a new one if the block didn't have an
  12993. annotation already.
  12994. * tree-ssa-ccp.c (substitute_and_fold): Rename from
  12995. ssa_ccp_substitute_constants. Update all users.
  12996. Call replace_uses_in.
  12997. (replace_uses_in): New local function.
  12998. (evaluate_expr): Call it.
  12999. (initialize): Call get_base_symbol.
  13000. * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Don't handle
  13001. E_FCALL.
  13002. 2002-09-22 Diego Novillo <dnovillo@redhat.com>
  13003. * Makefile.in (tree-dfa.o): Depend on hashtab.h.
  13004. * c-simplify.c (get_name): Declare extern.
  13005. * tree-cfg.c (tree_dump_cfg): Call it.
  13006. (tree_cfg2dot): Call it.
  13007. * tree-ssa-ccp.c (tree_ssa_ccp): Call get_name.
  13008. * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Call get_name.
  13009. * tree-ssa-pre.c (tree_perform_ssapre): Call get_name.
  13010. * tree-ssa.c (analyze_rdefs): Call get_name.
  13011. (dump_reaching_defs): Call get_name.
  13012. (dump_tree_ssa): Call get_name.
  13013. * tree.h (get_name): Declare.
  13014. * tree-dfa.c: Include "hashtab.h"
  13015. (struct dfa_stats_d): New.
  13016. (collect_dfa_stats): New local function.
  13017. (collect_dfa_stats_r): New local function.
  13018. (count_tree_refs): New local function.
  13019. (count_ref_list_nodes): New local function.
  13020. (tree_find_refs): Call dump_begin on entry to the function.
  13021. (dump_referenced_vars): Call get_name.
  13022. (SCALE): Declare.
  13023. (LABEL): Declare.
  13024. (dump_dfa_stats): New function.
  13025. (debug_dfa_stats): New function.
  13026. * tree-dump.c (struct dump_option_value_info): Add entry for TDF_STATS.
  13027. * tree-flow.h (has_annotation): Remove. Update all users.
  13028. (dump_dfa_stats): Declare.
  13029. (debug_dfa_stats): Declare.
  13030. (tree_annotation): Don't create one if the tree doesn't have one
  13031. already. Update all users to new semantics.
  13032. * tree-ssa-dce.c (print_stats): Dump if dump_flags has TDF_STATS bit
  13033. set.
  13034. * tree-ssa.c (tree_build_ssa): Open dump file on entry.
  13035. Call dump_dfa_stats if dump_flags has TDF_STATS bit set.
  13036. Call dump_tree_ssa if dump_flags has TDF_DETAILS bit set.
  13037. * tree.h (TDF_STATS): Define.
  13038. * doc/invoke.texi: Document 'stats' flag for -fdump-tree.
  13039. * tree-dfa.c (next_tree_ref_id): Change type to unsigned long.
  13040. Update all users.
  13041. tree-flow.h (tree_ref_common): Change type of field 'id' to
  13042. unsigned long. Update all users.
  13043. (ref_id): Change return type to unsigned long. Update all users.
  13044. 2002-09-21 Daniel Berlin <dberlin@dberlin.org>
  13045. * tree-ssa-pre.c (struct expr_info): Add repaired member.
  13046. (repair_injury): Track which injuries we repaired, so we don't
  13047. repair them > 1 time.
  13048. 2002-09-20 Diego Novillo <dnovillo@redhat.com>
  13049. * c-pretty-print.c (dump_c_node): Fix call to REAL_VALUE_TO_DECIMAL.
  13050. 2002-09-20 Diego Novillo <dnovillo@redhat.com>
  13051. * tree-dfa.c (find_refs_in_stmt): Fix botched call to
  13052. clobber_vars_r with CLEANUP_STMT nodes.
  13053. 2002-09-20 Diego Novillo <dnovillo@redhat.com>
  13054. * toplev.c (flag_tree_ssa): Remove. Update all users.
  13055. 2002-09-20 Frank Ch. Eigler <fche@redhat.com>
  13056. * gcc.c (cc1_options): Make -fmudflap imply -fno-merge-constants.
  13057. * varasm.c (categorize_decl_for_section): Likewise, for strings.
  13058. * tree-mudflap.c (mudflap_enqueue_decl): Don't be interested
  13059. in !TREE_USED decls. Fix minor type warning.
  13060. (mf_offset_expr_of_array_ref): Create explicit temporary variables
  13061. for array index expressions instead of SAVE_EXPRs. Update callers.
  13062. (mf_build_check_statement_for): Insert temp variables.
  13063. (mx_xfn_indirect_ref): Correct recursion-protection checking
  13064. sequence. Tweak array check-base calculation back to "&array[0]".
  13065. (*): Use build_function_type_list instead of build_function_type.
  13066. (mx_external_ref): Remove unused parameter. Update callers.
  13067. 2002-09-19 Diego Novillo <dnovillo@redhat.com>
  13068. * c-decl.c (c_expand_body): Invoke tree optimizers with -O1 and
  13069. above.
  13070. * flags.h (flag_tree_ssa): Remove.
  13071. * tree-cfg.c (find_expr_in_tree_helper): Change last argument type
  13072. to int.
  13073. * tree-dfa.c (create_ref): Ditto.
  13074. * tree-flow.h (num_referenced_vars): Change type to unsigned long.
  13075. * doc/invoke.texi (-ftree-ssa): Remove.
  13076. (-fdump-tree-{pre,ccp,dce}): Add to the summary section.
  13077. (-fdump-tree-xxx-details): Update documentation.
  13078. (-fdump-tree-ccp): Document.
  13079. (-fdump-tree-simple): Move elsewhere.
  13080. 2002-09-19 Richard Henderson <rth@redhat.com>
  13081. * function.c (insns_for_mem_hash): Cast to size_t first.
  13082. * tree-dfa.c (num_referenced_vars): Unsigned long, not size_t.
  13083. (dump_referenced_vars): Use %lu for it.
  13084. (dump_ref): Use HOST_WIDE_INT_PRINT_DEC.
  13085. * tree-nomudflap.c (mudflap_c_function): Use ATTRIBUTE_UNUSED.
  13086. (mudflap_enqueue_decl, mudflap_enqueue_constant): Likewise.
  13087. * tree-ssa-pre.c (compute_idfs): Cast to size_t first.
  13088. * tree-optimize.c (optimize_function_tree): Fix missed renamings.
  13089. * tree-ssa-pre.c (tree_perform_ssapre): Likewise.
  13090. 2002-09-19 Jeff Law <law@redhat.com>
  13091. * tree-dfa.c (find_refs_in_stmt): Search for references in the call
  13092. address of a CALL_EXPR.
  13093. 2002-09-19 Daniel Berlin <dberlin@dberlin.org>
  13094. * toplev.c: tree-ssa-* -> tree-*.
  13095. * doc/invoke.texi: Ditto.
  13096. 2002-09-19 Daniel Berlin <dberlin@dberlin.org>
  13097. * flags.h: flag_tree_ssa_* -> flag_tree_*.
  13098. * toplev.c: Ditto.
  13099. * tree-optimize.c: Ditto.
  13100. * tree-dump.c: dump-tree-ssa-* -> dump-tree-*.
  13101. TDI_ssa_* -> TDI_*.
  13102. * tree.h: Ditto
  13103. * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Fix dump handling.
  13104. 2002-09-18 Daniel Berlin <dberlin@dberlin.org>
  13105. * tree-dump.c (dump_files): Use dump-tree-ssa-??? for the option names
  13106. and "ssa-???" for the dump files.
  13107. * tree.h: TDI_ccp and TDI_dce -> TDI_ssa_ccp and TDI_ssa_dce.
  13108. * tree-ssa-ccp.c: TDI_ccp->TDI_ssa_ccp.
  13109. 2002-09-18 Daniel Berlin <dberlin@dberlin.org>
  13110. * tree-dump.c: Fix order of dump files
  13111. 2002-09-17 Daniel Berlin <dberlin@dberlin.org>
  13112. * tree-ssa-pre.c: Remove a lot of finding refs in statements junk.
  13113. Start on strength reduction.
  13114. Only generate simple statements.
  13115. Remove EXPR* macros in favor of inline functions.
  13116. Update comparisons and sets to 1 and 0 to true and false where
  13117. approriate.
  13118. (toplevel): Add DEBUGGING_STRRED define (temporary, for
  13119. implementation debugging, *not* useful as a dump option).
  13120. Add TODO notes.
  13121. Add global avdefs, orig_expr_map, need_repair_map,
  13122. strred_candidate.
  13123. (set_var_phis): Add struct expr_info * argument.
  13124. Update to handle injuring definitions.
  13125. (defs_y_dom_x): Ditto.
  13126. (phi_opnd_from_res): Ditto.
  13127. (phi_for_operand): Remove extra \.
  13128. (find_tree_ref_for_var): Renamed to find_use_for_var. Update all
  13129. callers.
  13130. Use orig_expr_map to lookup original expression, remove statement
  13131. searching gunk.
  13132. (find_rhs_use_for_var): New function.
  13133. (is_strred_cand): New function.
  13134. (is_injuring_def): New function.
  13135. (calculate_increment): New function.
  13136. (repair_injury): New function.
  13137. (set_need_repair): New function.
  13138. (struct expr_info): Add strred_cand member.
  13139. (rename_2): Update to handle injuring definitions.
  13140. (expr_phi_insertion): Ditto.
  13141. (code_motion): Update to repair injuries.
  13142. Only insert SIMPLE statements.
  13143. Free avdefs here now.
  13144. (finalize_1): Don't free avdefs anymore here.
  13145. (tree_perform_ssapre): Record original expresion for
  13146. find_use_for_var's benefit.
  13147. Determine strength reduction candidates.
  13148. * tree-flow.h: Remove EXPR* macros in favor of inline functions.
  13149. Remove E_INJ.
  13150. * tree-dfa.c: Change EXPR* macros to the new functions.
  13151. Remove E_INJ.
  13152. 2002-09-18 Diego Novillo <dnovillo@redhat.com>
  13153. * tree-dfa.c (M_ADDRESSOF): Define.
  13154. (find_refs_in_expr): Create addressof-use references for ADDR_EXPR
  13155. nodes.
  13156. Don't create references for FUNCTION_DECL nodes.
  13157. (ref_type_name): Handle M_ADDRESSOF.
  13158. (validate_ref_type): Ditto.
  13159. (clobber_vars_r): Don't clobber FUNCTION_DECL nodes.
  13160. * tree-flow.h (M_ADDRESSOF): Declare.
  13161. 2002-09-17 Diego Novillo <dnovillo@redhat.com>
  13162. * doc/invoke.texi: Document -ftree-ssa-dce and -fdump-tree-dce.
  13163. * cp/Make-lang.in (CXX_C_OBJS): Add tree-ssa-dce.o.
  13164. 2002-09-17 Ben Elliston <bje@redhat.com>
  13165. * Makefile.in (C_AND_OBJC_OBJS): Add tree-ssa-dce.o.
  13166. tree-ssa-dce.o): New target.
  13167. * tree-ssa-dce.c: New file.
  13168. * flags.h (flag_tree_ssa_dce): Declare flag.
  13169. * tree.h (tree_dump_index): Add TDI_dce.
  13170. * toplev.c (flag_tree_ssa_dce): New flag.
  13171. (f_options): Add "dump-tree-all-ssa" option.
  13172. * tree-flow.h (enum tree_flags): Add TF_NECESSARY.
  13173. * tree-dump.c (dump_files): Add dump-tree-dce option.
  13174. (dump_enable_all_ssa): Enable it when dumping all.
  13175. * tree-optimize.h (tree_ssa_eliminate_dead_code): Declare.
  13176. * tree-optimize.c (optimize_function_tree): Invoke the
  13177. optimisation pass if flag_tree_ssa_dce is set.
  13178. 2002-09-17 Diego Novillo <dnovillo@redhat.com>
  13179. * Makefile.in (tree-ssa.o): Add dependency on c-tree.h
  13180. * c-simplify.c (mark_not_simple_r): Don't mark IDENTIFIER_NODEs.
  13181. * tree-dfa.c (function_may_recurse_p): Fix comment.
  13182. (dump_ref): Don't dump immediate uses for PHI nodes more than once.
  13183. (dump_referenced_vars): Unparse the name of the variable.
  13184. * tree-flow.h (dump_tree_ssa): Declare.
  13185. (debug_tree_ssa): Declare.
  13186. (replace_ref_operand_with): Check if OPERAND_P is NULL.
  13187. (restore_ref_operand): Ditto.
  13188. (tree_annotation): Check that constants, types and IDENTIFIER_NODEs
  13189. are not being annotated.
  13190. * tree-ssa.c: Include c-tree.h.
  13191. (dump_reaching_defs): Unparse the variable name.
  13192. (dump_tree_ssa): New function.
  13193. (tree_build_ssa): Call it.
  13194. (debug_tree_ssa): New function.
  13195. 2002-09-14 Steven Bosscher <s.bosscher@student.tudelft.nl>
  13196. * dwarf2out.c (is_fortran): Return true for
  13197. DW_LANG_Fortran95.
  13198. (gen_compile_unit_die): Return DW_LANG_Fortran95 if
  13199. language is "GNU F95".
  13200. 2002-09-13 Daniel Berlin <dberlin@dberlin.org>
  13201. * tree-dump.c (dump_switch_p): Get longest match, not first one.
  13202. * tree.h: Put TDI_* back in order, now that we do longest match
  13203. matching.
  13204. 2002-09-13 Diego Novillo <dnovillo@redhat.com>
  13205. * tree-dfa.c (add_call_site_clobbers): Call decl_function_context
  13206. instead of DECL_CONTEXT.
  13207. * tree-ssa-ccp.c (initialize): Ditto.
  13208. * tree-ssa.c (analyze_rdefs): Ditto.
  13209. 2002-09-11 Diego Novillo <dnovillo@redhat.com>
  13210. * tree-dfa.c (find_refs_in_stmt): Call clobber_vars_r to clobber
  13211. CLEANUP_STMT nodes.
  13212. (create_ref): Only add _DECL nodes to the list of referenced
  13213. variables.
  13214. (clobber_vars_r): Create a may-use reference prior to clobbering
  13215. the variable.
  13216. (add_call_site_clobbers): Ditto.
  13217. (add_ptr_may_refs): Move call to find_list_node where it's actually
  13218. needed.
  13219. * tree-flow.h: Update documentation on M_CLOBBER.
  13220. 2002-09-10 Daniel Berlin <dberlin@dberlin.org>
  13221. * tree-ssa-pre.c (defs_match_p): Fix typo ( | -> || ).
  13222. 2002-09-10 Diego Novillo <dnovillo@redhat.com>
  13223. * tree-dfa.c (V_PHI_ARG): Remove. Adjust related constants.
  13224. Update all users.
  13225. (add_ref_to_list_after): Don't allocate memory for the
  13226. node when adding to the beginning or the end of the list.
  13227. (add_phi_arg): Don't call create_ref to add a new argument.
  13228. (debug_phi_args): New function.
  13229. (dump_phi_args): New function.
  13230. (dump_ref): Call it.
  13231. (dump_referenced_vars): Use 'file' instead of 'dump_file'.
  13232. * tree-flow.h (V_PHI_ARG): Remove. Update all users.
  13233. (struct var_ref): Move fields used in distinct
  13234. reference types to other structures. Update all users.
  13235. (struct var_def): New.
  13236. (struct var_phi): New.
  13237. (struct var_use): New.
  13238. (union tree_ref_d): Add members vdef, vphi, vuse and vphi_arg.
  13239. Update all users.
  13240. (save_chain): Remove. Update all users.
  13241. (set_save_chain): Remove. Update all users.
  13242. (marked_with): Remove. Update all users.
  13243. (mark_def_with): Remove. Update all users.
  13244. (dump_reaching_defs): Declare.
  13245. (debug_reaching_defs): Declare.
  13246. (struct phi_node_arg_d): New structure.
  13247. (phi_node_arg): New type.
  13248. (phi_arg): Change return type to phi_node_arg.
  13249. (imm_reaching_def_edge): Rename to phi_arg_edge.
  13250. (set_imm_reaching_def_edge): Rename to set_phi_arg_edge.
  13251. (phi_arg_def): New inline function.
  13252. (set_phi_arg_def): New inline function.
  13253. (debug_phi_args): Declare.
  13254. (dump_phi_args): Declare.
  13255. * tree-ssa-ccp.c: Use new phi_node_arg type when examining PHI node
  13256. arguments.
  13257. * tree-ssa-pre.c: Ditto.
  13258. * tree-ssa.c (save_chain): New local variable.
  13259. (build_fud_chains, search_fud_chains): Use it.
  13260. (marked): New local variable.
  13261. (tree_compute_rdefs, follow_chain): Use it.
  13262. (dump_reaching_defs): New function.
  13263. (debug_reaching_defs): New function.
  13264. 2002-09-09 Daniel Berlin <dberlin@dberlin.org>
  13265. * Makefile.in (tree-alias-steen.o): Remove gt-tree-alias-steen.h
  13266. (tree-alias-common.o): Add dependency on c-common.h
  13267. * tree-ssa-pre.c: Fix PRE now that V_USE's expr's are the entire
  13268. assignment, rather than just the right hand side.
  13269. Stop generating our own call clobbers
  13270. * tree-dfa.c (create_ref): Make sure var is not null before checking
  13271. TREE_THIS_VOLATILE.
  13272. * tree.h: Reorder TDI_* so ssapre comes before ssa.
  13273. * tree-dump.c: dump-tree-ssapre has to come before dump-tree-ssa
  13274. in the table, or else it'll never match.
  13275. 2002-09-09 Frank Ch. Eigler <fche@redhat.com>
  13276. * tree-mudflap.c (mf_offset_expr_of_array_ref): Fold constants along
  13277. the way.
  13278. (mf_build_check_statement_for): Ditto. Flag new COMPONENT_REFs.
  13279. (mx_xfn_indirect_ref): Instrument COMPONENT_REFs specially. Tweak
  13280. ARRAY_REF instrumentation to reduce need of copying and recursion.
  13281. 2002-09-09 Diego Novillo <dnovillo@redhat.com>
  13282. * tree-ssa.c (analyze_rdefs): Disable uninitialized variable warnings.
  13283. 2002-09-09 Diego Novillo <dnovillo@redhat.com>
  13284. * Makefile.in (tree-ssa.o): Add dependency on tree-simple.h.
  13285. (tree-dfa.o): Add dependency on tree-simple.h and tree-inline.h.
  13286. (tree-alias-steen.o): Add dependency on c-common.h.
  13287. (tree-optimize.o): Add dependency on c-common.h.
  13288. * c-simplify.c (deep_copy_node): Call walk_tree with mostly_copy_tree_r.
  13289. (mostly_copy_tree_r): Also copy flags from original tree.
  13290. (mark_not_simple_r): Call set_tree_flag.
  13291. * tree-alias-steen.c: Include c-common.h.
  13292. * tree-cfg.c (map_stmt_to_bb): Remove.
  13293. (block_invalidates_loop): Change return type to bool.
  13294. (create_loop_hdr): New function.
  13295. (create_bb): Call it.
  13296. (create_bb_ann): Return newly created annotation object.
  13297. (remove_bb_ann): Nullify loop_hdr annotation, if there is one.
  13298. (tree_delete_bb): Only remove basic block annotation from
  13299. executables statements.
  13300. (is_computed_goto): New function.
  13301. * tree-dfa.c (pointer_refs): New file local variable.
  13302. (call_sites): New global variable.
  13303. (V_DEF, V_USE, V_PHI, V_PHI_ARG, E_FCALL, E_PHI, E_USE, E_KILL,
  13304. E_INJ): New global constants.
  13305. (M_DEFAULT, M_CLOBBER, M_MAY, M_PARTIAL, M_INITIAL, M_INDIRECT,
  13306. M_VOLATILE): New global constants.
  13307. (num_referenced_vars): New global variable.
  13308. (referenced_vars): Rename from referenced_symbols. Update all
  13309. users.
  13310. (clobber_vars_r): New function.
  13311. (add_default_defs): New function.
  13312. (add_call_site_clobbers): New function.
  13313. (add_ptr_may_refs): New function.
  13314. (add_phi_arg): New function.
  13315. (find_list_node): New function.
  13316. (remove_ref_from_list): Call it.
  13317. (add_ref_to_list_after): New function.
  13318. (is_pure_fcall): New function.
  13319. (fcall_takes_ref_args): New function.
  13320. (dump_referenced_vars): New function.
  13321. (debug_referenced_vars): New function.
  13322. (ref_type_name): New function.
  13323. (validate_ref_type): New function.
  13324. (debug_phi_args): Remove.
  13325. (dump_phi_args): Remove.
  13326. (add_referenced_var): Rename from add_ref_symbol. Update all
  13327. users.
  13328. (dump_ref): Rename from dump_varref. Update all users.
  13329. (debug_ref): Rename from debug_varref. Update all users.
  13330. (dump_ref_list): Rename from dump_varref_list. Update all users.
  13331. (dump_ref_array): Rename from dump_varref_array. Update all users.
  13332. (next_tree_ref_id): Rename from next_varref_id. Update all users.
  13333. (tree_find_refs): Rename from tree_find_varrefs. Update all users.
  13334. Call add_default_defs.
  13335. Call add_call_site_clobbers.
  13336. Call add_ptr_may_refs.
  13337. Call dump_referenced_vars.
  13338. Create and destroy pointer_refs list.
  13339. (find_refs_in_stmt): Set reference type to clobbering definition
  13340. for the ASM_OUTPUTS and ASM_CLOBBERS expressions of an ASM_STMT.
  13341. Set reference type to initial definition for the DECL_INITIAL node
  13342. of a DECL_STMT.
  13343. Clobber everything in CLEANUP_STMT nodes.
  13344. (find_refs_in_expr): Re-write.
  13345. Recursively clobber every VAR_DECL contained in non SIMPLE nodes.
  13346. Mark indirect pointer references with M_INDIRECT flag.
  13347. Add pointer references to pointer_refs list.
  13348. Glob references to arrays and structures.
  13349. Add function call expressions to call_sites list.
  13350. (empty_ref_list): Do nothing if the list is empty already.
  13351. (delete_ref_list): Ditto.
  13352. (create_ref): Add new argument ADD_TO_BB.
  13353. Set M_VOLATILE modifier if this is a reference to a volatile
  13354. variable.
  13355. Count number of incoming edges for V_PHI references before
  13356. initializing the V_PHI_ARG array.
  13357. Only add reference to basic block if ADD_TO_BB is true.
  13358. Set output reference for the parent expression for V_DEF
  13359. references.
  13360. (remove_tree_ann): Do nothing if the tree didn't have an
  13361. annotation.
  13362. * tree-flow.h (enum treeref_type): Remove. Update all users.
  13363. (union varref_def): Ditto.
  13364. (tree_ref): Rename from varref. Update all users.
  13365. (V_DEF): Declare.
  13366. (V_USE): Declare.
  13367. (V_PHI): Declare.
  13368. (V_PHI_ARG): Declare.
  13369. (E_FCALL): Declare.
  13370. (E_PHI): Declare.
  13371. (E_USE): Declare.
  13372. (E_KILL): Declare.
  13373. (E_INJ): Declare.
  13374. (M_DEFAULT): Declare.
  13375. (M_CLOBBER): Declare.
  13376. (M_MAY): Declare.
  13377. (M_PARTIAL): Declare.
  13378. (M_INITIAL): Declare.
  13379. (M_INDIRECT): Declare.
  13380. (M_VOLATILE): Declare.
  13381. (struct tree_ref_common): Rename from treeref_common. Update all
  13382. users.
  13383. Change type of field 'type' to HOST_WIDE_INT.
  13384. Rename field 'sym' to 'var'.
  13385. (struct var_ref): Rename from varref. Update all users.
  13386. Join the structures varuse
  13387. and vardef into a single structure.
  13388. (struct expr_ref_common): Rename from exprref_common. Update all
  13389. users.
  13390. (struct expr_use): Rename from expruse. Update all users.
  13391. (struct expr_phi): Rename from exprphi. Update all users.
  13392. (union tree_ref_d): Rename from varref_def. Update all users.
  13393. (EXPRPHI_PHI_ARGS): Rename from EXPRPHI_PHI_CHAIN. Update all
  13394. users.
  13395. (struct tree_ann_d): Rename field 'compound_stmt' to
  13396. 'compound_parent'.
  13397. Add field 'output_ref'.
  13398. (enum tree_flags): New enum.
  13399. (TF_REFERENCED): New flag.
  13400. (phi_arg): Remove.
  13401. (get_num_phi_args): Remove.
  13402. (get_phi_arg): Remove.
  13403. (struct vardef): Remove. Update all users.
  13404. (VARDEF_IMM_USES): Ditto.
  13405. (VARDEF_SAVE_CHAIN): Ditto.
  13406. (VARDEF_RUSES): Ditto.
  13407. (VARDEF_MARKED): Ditto.
  13408. (VARDEF_PHI_ARGS): Ditto.
  13409. (struct varuse): Ditto.
  13410. (VARUSE_IMM_RDEF): Ditto.
  13411. (VARUSE_RDEFS): Ditto.
  13412. (VARREF_ID): Ditto.
  13413. (VARREF_TYPE): Ditto.
  13414. (VARREF_BB): Ditto.
  13415. (VARREF_EXPR): Ditto.
  13416. (VARREF_OPERAND_P): Ditto.
  13417. (VARREF_STMT): Ditto.
  13418. (VARREF_SYM): Ditto.
  13419. (IS_DEFAULT_DEF): Ditto.
  13420. (IS_ARTIFICIAL_REF): Ditto.
  13421. (TREE_ANN): Ditto.
  13422. (BB_FOR_STMT): Ditto.
  13423. (TREE_CURRDEF): Ditto.
  13424. (TREE_REFS): Ditto.
  13425. (TREE_COMPOUND_STMT): Ditto.
  13426. (TREE_FLAGS): Ditto.
  13427. (BB_ANN): Ditto.
  13428. (BB_PARENT): Ditto.
  13429. (BB_REFS): Ditto.
  13430. (BB_PREV_CHAIN_P): Ditto.
  13431. (BB_BINDING_SCOPE): Ditto.
  13432. (BB_LOOP_HDR): Ditto.
  13433. (FOR_INIT_STMT_BB): Ditto.
  13434. (FOR_COND_BB): Ditto.
  13435. (FOR_EXPR_BB): Ditto.
  13436. (END_WHILE_BB): Ditto.
  13437. (DO_COND_BB): Ditto.
  13438. (BB_EMPTY_P): Ditto.
  13439. (ref_type): New inline function.
  13440. (ref_var): New inline function.
  13441. (ref_stmt): New inline function.
  13442. (ref_expr): New inline function.
  13443. (ref_bb): New inline function.
  13444. (ref_id): New inline function.
  13445. (replace_ref_operand_with): New inline function.
  13446. (restore_ref_operand): New inline function.
  13447. (imm_uses): New inline function.
  13448. (save_chain): New inline function.
  13449. (set_save_chain): New inline function.
  13450. (reached_uses): New inline function.
  13451. (marked_with): New inline function.
  13452. (mark_def_with): New inline function.
  13453. (phi_args): New inline function.
  13454. (num_phi_args): New inline function.
  13455. (phi_arg): New inline function.
  13456. (imm_reaching_def): New inline function.
  13457. (set_imm_reaching_def): New inline function.
  13458. (imm_reaching_def_edge): New inline function.
  13459. (set_imm_reaching_def_edge): New inline function.
  13460. (reaching_defs): New inline function.
  13461. (tree_annotation): New inline function.
  13462. (has_annotation): New inline function.
  13463. (bb_for_stmt): New inline function.
  13464. (set_bb_for_stmt): New inline function.
  13465. (currdef_for): New inline function.
  13466. (set_currdef_for): New inline function.
  13467. (tree_refs): New inline function.
  13468. (add_tree_ref): New inline function.
  13469. (remove_tree_ref): New inline function.
  13470. (compound_parent): New inline function.
  13471. (set_compound_parent): New inline function.
  13472. (set_tree_flag): New inline function.
  13473. (clear_tree_flag): New inline function.
  13474. (tree_flags): New inline function.
  13475. (reset_tree_flags): New inline function.
  13476. (output_ref): New inline function.
  13477. (set_output_ref): New inline function.
  13478. (bb_annotation): New inline function.
  13479. (bb_parent): New inline function.
  13480. (set_bb_parent): New inline function.
  13481. (bb_refs): New inline function.
  13482. (remove_bb_ref): New inline function.
  13483. (prev_chain_p): New inline function.
  13484. (set_prev_chain_p): New inline function.
  13485. (binding_scope): New inline function.
  13486. (set_binding_scope): New inline function.
  13487. (header_blocks): New inline function.
  13488. (for_init_bb): New inline function.
  13489. (set_for_init_bb): New inline function.
  13490. (for_cond_bb): New inline function.
  13491. (set_for_cond_bb): New inline function.
  13492. (for_expr_bb): New inline function.
  13493. (set_for_expr_bb): New inline function.
  13494. (end_while_bb): New inline function.
  13495. (set_end_while_bb): New inline function.
  13496. (do_cond_bb): New inline function.
  13497. (set_do_cond_bb): New inline function.
  13498. (bb_empty_p): New inline function.
  13499. (referenced_vars): Rename from referenced_symbols. Update all
  13500. users.
  13501. (num_referenced_vars): Declare.
  13502. (NREF_SYMBOLS): Remove. Update all users.
  13503. (REF_SYMBOL): Ditto.
  13504. (ADD_REF_SYMBOL): Ditto.
  13505. (referenced_var): New inline function.
  13506. (call_sites): Declare.
  13507. (next_tree_ref_id): Rename from next_varref_id. Update all users.
  13508. (is_computed_goto): Declare.
  13509. (is_pure_fcall): Declare.
  13510. (fcall_takes_ref_args): Declare.
  13511. (add_ref_to_list_after): Declare.
  13512. (find_list_node): Declare.
  13513. (ref_type_name): Declare.
  13514. (validate_ref_type): Declare.
  13515. * tree-optimize.c: Include c-common.h.
  13516. (optimize_function_tree): Store DECL_SAVED_TREE in a local
  13517. variable.
  13518. * tree-ssa-ccp.c (cp_lattice_meet): New function.
  13519. (visit_phi_node): Call it.
  13520. (add_outgoing_control_edges): New function.
  13521. (visit_expression_for): Call it.
  13522. Don't handle static initializers.
  13523. Handle computed gotos.
  13524. (add_control_edge): New function.
  13525. (visit_condexpr_for, simulate_block, add_outgoing_control_edges): Call
  13526. it.
  13527. (simulate_def_use_chains): Only look at unmodified V_USE references.
  13528. (ssa_ccp_substitute_constants): Ditto.
  13529. (evaluate_expr): Ditto.
  13530. (initialize): Set initial value for incoming parameters and globals
  13531. to VARYING.
  13532. Set initial value for initialized static variables to VARYING,
  13533. unless the variable is read-only.
  13534. (set_lattice_value): Don't special case globals, volatiles and
  13535. variables with their address taken.
  13536. * tree-ssa.c: Include tree-simple.h.
  13537. (tree_build_ssa): Don't add default definitions.
  13538. (insert_phi_terms): Add new PHI nodes at the beginning of the list
  13539. of references for the basic block.
  13540. (search_fud_chains): Add def-def chains for non-killing
  13541. definitions.
  13542. (delete_ssa): Remove list call_sites.
  13543. Set num_referenced_vars to 0.
  13544. Set referenced_vars to NULL.
  13545. (follow_chain): Follow def-def chains for non-killing definitions.
  13546. (is_upward_exposed): Change return type to bool.
  13547. (add_phi_arg): Remove.
  13548. 2002-09-06 Frank Ch. Eigler <fche@redhat.com>
  13549. * tree-mudflap.c (deferred_static_decl*): Correct GTY markup.
  13550. (mudflap_enqueue_decl): Correct iteration bounds.
  13551. (mf_init_extern_trees): Add more constness to mf_cache_structptr_type.
  13552. (mf_offset_expr_of_array_ref): Remove excess mx_flagging. save_expr
  13553. array subscripts.
  13554. (mf_build_check_statement_for): Reorganize to take explicit
  13555. check-base/size arguments, in addition to value argument. save_expr
  13556. array subscripts. Copy value/base/size subtrees.
  13557. (mx_xfn_indirect_ref): Support marking of subtrees for nontraversal.
  13558. Track source line numbers more aggressively. For arrays, check bounds
  13559. from base through indexed element, not just the indexed element.
  13560. Use nontraversal flagging to eliminate some excess instrumentation.
  13561. (mf_xform_derefs): Support nontraversal by a hash table.
  13562. (*): Remove "{{{"/"}}}" folding marks.
  13563. 2002-09-02 Daniel Berlin <dberlin@dberlin.org>
  13564. * tree-alias-common.[ch]: New files.
  13565. * tree-alias-steen.[ch]: Split out common stuff into
  13566. tree-alias-common.[ch].
  13567. * c-config-lang.in: Modify to use tree-alias-common.[ch] instead of
  13568. tree-alias-steen, since this is where the GTY'd stuff is now.
  13569. * Makefile.in: Add dependencies for tree-alias-common.[ch].
  13570. 2002-09-03 Diego Novillo <dnovillo@redhat.com>
  13571. * c-simplify.c (simplify_goto_stmt): New function.
  13572. (simplify_stmt): Call it.
  13573. * tree-simple.c: Document grammar for GOTO_STMT nodes.
  13574. (rationalize_compound_expr): Wrap it with #if 0/#endif.
  13575. (get_base_symbol): Minor comment fixup.
  13576. 2002-09-03 Frank Ch. Eigler <fche@redhat.com>
  13577. * gcc.c (MFWRAP_SPEC): Add --wrap=alloca.
  13578. 2002-09-01 Diego Novillo <dnovillo@redhat.com>
  13579. * c-simplify.c (simplify_stmt): Mark CLEANUP_STMTs and ASM_STMTs
  13580. not SIMPLE.
  13581. (simplify_for_stmt): Do not allow expression sequences in
  13582. FOR_INIT_STMT and FOR_EXPR nodes.
  13583. * tree-simple.c: Document difference with original SIMPLE grammar.
  13584. 2002-08-31 Frank Ch. Eigler <fche@redhat.com>
  13585. * tree-mudflap.c (mf_build_check_statement_for): Tolerate dereference
  13586. of void pointers.
  13587. (mx_register_decl): Correct typo in below patch.
  13588. 2002-08-30 Graydon Hoare <graydon@redhat.com>
  13589. * tree-mudflap.c (mx_register_decl): Mark declarations as
  13590. TREE_ADDRESSABLE when mudflap decides to register them.
  13591. 2002-08-29 Graydon Hoare <graydon@redhat.com>
  13592. * tree-mudflap.c (mx_xfn_indirect_ref): Rewrite array references as
  13593. pointer dereferences.
  13594. (struct mf_xform_decls_data): New member: param_decls.
  13595. (mx_register_decl): New function.
  13596. (mx_xfn_xform_decls): Factor code out into mx_register_decl.
  13597. Register live parameters with mudflap.
  13598. (mx_xfn_find_addrof): Notice references to fields of structures
  13599. and function parameters.
  13600. 2002-08-29 Frank Ch. Eigler <fche@redhat.com>
  13601. * c-pretty-print.c (dump_c_tree): Detect loops in statement chains
  13602. using a hash table to track visited status.
  13603. * Makefile.in: Add hashtab.h dependency.
  13604. 2002-08-28 Frank Ch. Eigler <fche@redhat.com>
  13605. * tree-mudflap.c (mudflap_enqueue_constant): Register non-string
  13606. constants also.
  13607. (mf_build_check_statement_for): Include pushlevel/pushdecl/poplevel
  13608. for local variables.
  13609. 2002-08-27 Frank Ch. Eigler <fche@redhat.com>
  13610. Better static registration:
  13611. * varasm.c (make_decl_rtl): Handle DECL_RTL_SET_P case for
  13612. mudflap static registration.
  13613. * tree-mudflap.c (mudflap_enqueue_decl): Rewrite to handle
  13614. deferred statics.
  13615. (mudflap_finish_file): Call above fn back for deferred statics.
  13616. Cleanup:
  13617. * tree-mudflap.c (mf_varname_tree, mf_file_function_line_tree):
  13618. Reorganize output_buffer reuse mechanism.
  13619. (mf_build_check_statement_for): Set TREE_SIDE_EFFECTS.
  13620. (mx_xfn_indirect_ref): Correct file/line collection tests.
  13621. Dynamic linking support:
  13622. * gcc.c (MFWRAP_SPEC): Make conditional on -static. Add the
  13623. newer wrapped functions dlopen/mmap/munmap.
  13624. (MFLIB_SPEC): Be sensitive to -static. Partial support for
  13625. dynamic linking.
  13626. 2002-08-26 Diego Novillo <dnovillo@redhat.com>
  13627. * Makefile.in (tree-ssa.o): Add dependency on ggc.h
  13628. (c-simplify.o): Add dependency on langhooks-def.h
  13629. * c-simplify.c: Include langhooks-def.h
  13630. (simplify_function_tree): Do nothing if the front end does not
  13631. support simplification.
  13632. * tree-flow.h (struct vardef): Remove fields 'phi_chain' and
  13633. 'phi_chain_bb'.
  13634. Add field 'phi_args'.
  13635. (VARDEF_PHI_CHAIN): Remove. Update all users.
  13636. (VARDEF_PHI_CHAIN_BB): Remove. Update all users.
  13637. (VARDEF_PHI_ARGS): Define.
  13638. (struct varuse): Rename field 'chain' to 'imm_rdef'. Update all
  13639. users.
  13640. (VARUSE_IMM_RDEF): Rename from VARUSE_CHAIN. Update all users.
  13641. (phi_arg): New structure.
  13642. (get_num_phi_args): New function.
  13643. (get_phi_arg): New function.
  13644. (set_phi_arg): New function.
  13645. (add_phi_arg): New function.
  13646. (debug_phi_args): Declare.
  13647. (dump_phi_args): Declare.
  13648. * tree-dfa.c (create_ref): Remove initialization of
  13649. VARDEF_PHI_CHAIN and VARDEF_PHI_CHAIN_BB.
  13650. Initialize array VARDEF_PHI_ARGS.
  13651. (dump_varref): Call dump_phi_args.
  13652. (dump_phi_args): New function.
  13653. (debug_phi_args): New function.
  13654. * tree-ssa-ccp.c (PHI_PARMS): Remove.
  13655. (EIE): Remove.
  13656. (visit_phi_node): Get the argument's edge directly from the
  13657. argument instead of calling find_edge.
  13658. (initialize): Cast call to NUM_EDGES to unsigned.
  13659. * tree-ssa-pre.c: Update uses of VARDEF_PHI_CHAIN,
  13660. VARDEF_PHI_CHAIN_BB and VARUSE_CHAIN everywhere.
  13661. * tree-ssa.c: Ditto.
  13662. Include ggc.h.
  13663. (search_fud_chains): Call add_phi_arg to add arguments to each PHI
  13664. node.
  13665. (tree_ssa_remove_phi_alternative): Call set_phi_arg to switch the
  13666. last element with the element being removed.
  13667. 2002-08-26 Diego Novillo <dnovillo@redhat.com>
  13668. * c-simplify.c (mostly_copy_tree_r): Unshare STMT_EXPR
  13669. nodes.
  13670. 2002-08-25 Diego Novillo <dnovillo@redhat.com>
  13671. * tree-dfa.c (find_refs_in_stmt): Replace calls to
  13672. RETURN_EXPR with RETURN_STMT_EXPR.
  13673. * c-simplify.c (simplify_return_stmt): Ditto.
  13674. (deep_copy_node): Ditto.
  13675. * c-pretty-print.c (dump_c_node): Ditto.
  13676. 2002-08-24 Diego Novillo <dnovillo@redhat.com>
  13677. * c-pretty-print.c: Add `break' after calls to NIY in
  13678. switch statements.
  13679. 2002-08-23 Jeffrey A Law (law@redhat.com)
  13680. * tree-ssa-ccp.c (tree_ssa_ccp): Remove #if 0 that accidentally
  13681. got checked in. Cleanup the cfg to remove unreachable blocks
  13682. discovered by CCP.
  13683. * basic-block.h (EDGE_EXECUTABLE): New edge flag.
  13684. * cfganal.c (find_edge): New function.
  13685. * ssa-ccp.c: Convert to use EDGE_EXECUTABLE bit in the
  13686. edge flags rather than a bitmap. Convert edge worklist
  13687. into a varray. Avoids expensive find_index_edge calls.
  13688. * tree-ssa-ccp.c: Likewise.
  13689. * tree-flow.h (tree_ssa_remove_phi_alternative): Declare.
  13690. * tree-ssa.c (tree_ssa_remove_phi_alternative): New function.
  13691. * tree-ssa-ccp.c (optimize_unexecutable_edges): Remove
  13692. PHI alternatives for unexecutable edges. Also remove
  13693. unexecutable edges from the CFG.
  13694. 2002-08-22 Jeffrey A Law (law@redhat.com)
  13695. * Makefile.in (tree-optimize.o): Depend on tree-dchain.o
  13696. * tree-optimize.c: Include tree-dchain.h.
  13697. (optimize_function_tree): Unconditionally build and tear down
  13698. the backpointers for the statement chain.
  13699. 2002-08-22 Diego Novillo <dnovillo@redhat.com>
  13700. * tree-dfa.c (find_refs_in_stmt): Look for VARUSE references in
  13701. initialization expressions.
  13702. (find_refs_in_expr): Reformat.
  13703. (remove_ref_from_list): Optimize for the common case of removing
  13704. the head or the tail of the list.
  13705. (add_ref_to_list_end): Reformat comment.
  13706. (create_ref): Store the reference to LHS of assignment expressions.
  13707. (dump_varref): Also dump immediate uses of PHI nodes.
  13708. * tree-flow.h (IS_GHOST_DEF): Rename to IS_DEFAULT_DEF. Update all
  13709. callers everywhere.
  13710. (struct tree_ann_def): Update comments for field 'currdef'.
  13711. * tree-ssa-ccp.c (ssa_edges): Change type to ref_list.
  13712. (SSA_NAME): Remove.
  13713. (initialize): New function
  13714. (finalize): New function.
  13715. (visit_expression): Rename to visit_expression_for. Update all
  13716. callers.
  13717. (visit_condexpr_for): New function.
  13718. (visit_assignment): Rename to visit_assignment_for. Update all
  13719. callers.
  13720. (examine_flow_edges): Rename to simulate_block. Update all
  13721. callers.
  13722. (follow_def_use_chains): Rename to simulate_def_use_chains. Update
  13723. all callers.
  13724. (evaluate_expr_for): Rename to evaluate_expr. Change argument to
  13725. 'tree'.
  13726. (set_lattice_value): New function.
  13727. (tree_ssa_ccp): Change main loop to visit flow_edges and ssa_edges
  13728. alternately.
  13729. (visit_phi_node): Do not set the lattice value to UNDEFINED when we
  13730. find a non-executable edge.
  13731. (visit_expression_for): Default definitions for PARM_DECLs are
  13732. assigned a VARYING value.
  13733. Default definitions for any other local variables are assigned an
  13734. UNDEFINED value.
  13735. Clobber VARDEFs that are not the LHS of an assignment.
  13736. Clobber VARDEFs that initialize non-const static variables.
  13737. * tree-ssa.c (search_fud_chains): Set up def-use edges for PHI
  13738. nodes and regular definitions.
  13739. * tree.c (simple_cst_equal): Call simple_cst_list_equal to compare
  13740. CONSTRUCTOR_ELTS pointers.
  13741. 2002-08-22 Diego Novillo <dnovillo@redhat.com>
  13742. * c-pretty-print.c (buffer): New file local variable.
  13743. (initialized): New file local variable.
  13744. (print_c_tree): Don't call init_output_buffer. Call
  13745. maybe_init_pretty_print.
  13746. (print_c_node): Ditto.
  13747. (print_c_node_brief): Ditto.
  13748. (maybe_init_pretty_print): New function.
  13749. * tree-mudflap.c (mf_varname_tree): Only call init_output_buffer
  13750. once. Call output_clear_message_text before returning.
  13751. 2002-08-21 Frank Ch. Eigler <fche@redhat.com>
  13752. Support source-file/line coordinates in check/violation messages.
  13753. * tree-mudflap.c (mf_init_extern_trees): Add new "location" formal
  13754. arg to __mf_check.
  13755. (mf_file_function_line_tree): New function to build an actual location
  13756. string.
  13757. (build_check_statement_for): Call it / pass it.
  13758. (mx_xfn_indirect_ref): Track source file/line location via
  13759. STMT_LINENO, FILE_STMT, EXPR_WITH_FILE_LOCATION traversal memos.
  13760. 2002-08-21 Daniel Berlin <dberlin@dberlin.org>
  13761. * dominance.c: Cache immediate dominators.
  13762. 2002-08-20 Daniel Berlin <dberlin@dberlin.org>
  13763. * tree-alias-steen.h (struct tree_alias_ops): Add flag for
  13764. interprocedural.
  13765. * tree-alias-steen.c (steen_alias_ops): Set interprocedural to 0
  13766. for now.
  13767. (intra_function_call): New function to handle intraprocedural calling.
  13768. (finc_func_aliases): Use it.
  13769. Handle *x = *y, *x = &y, and *x = (cast) y.
  13770. (display_points_to_set_helper): New function, split from ...
  13771. (display_points_to_set): Here.
  13772. (create_alias_vars): Try to print all alias vars we find in the
  13773. alias_vars array, rather than just those that are linked directly to
  13774. trees.
  13775. Clear arrays when we finish if we aren't interprocedural.
  13776. 2002-08-20 Frank Ch. Eigler <fche@redhat.com>
  13777. static object registration support:
  13778. * tree-mudflap.c (mudflap_enqueue_decl, mudflap_enqueue_constant):
  13779. Replace stubs with real code.
  13780. (mf_enqueue_register_call): New function to generate asm-object
  13781. call to __mf_register.
  13782. (mf_flush_enqueued_calls): New function to emit global ctor function
  13783. with enqueued __mf_register calls.
  13784. (mf_varname_tree): Tolerate being called from non-function context.
  13785. * c-objc-common.c: #include <tree-mudflap.h>.
  13786. gengtypes support for mudflap:
  13787. * Makefile.in (GTFILES): Include tree-mudflap.c.
  13788. (gt-tree-mudflap.h): New target.
  13789. * tree-mudflap.c: Annotate global tree nodes with GTY(()).
  13790. * tree-nomudflap.c: Add dummy ggc root table.
  13791. 2002-08-19 Diego Novillo <dnovillo@redhat.com>
  13792. * tree-dfa.c (find_refs_in_expr): If the current sub-expression is
  13793. not SIMPLE, mark its parent.
  13794. (create_ref): If the parent expression is not SIMPLE, create
  13795. VARDEFs regardless of the original reference type.
  13796. * tree-ssa-ccp.c (widen_bitfield): New function.
  13797. (evaluate_expr_for): Call it.
  13798. 2002-08-18 Diego Novillo <dnovillo@redhat.com>
  13799. * tree-ssa-ccp.c (evaluate_expr_for): Fix thinko in
  13800. 2002-08-17 patch.
  13801. 2002-08-17 Diego Novillo <dnovillo@redhat.com>
  13802. * tree-ssa-ccp.c (evaluate_expr_for): keep VARREF_SYM in a local
  13803. variable.
  13804. 2002-08-16 Diego Novillo <dnovillo@redhat.com>
  13805. * basic-block.h (BB_CONTROL_EXPR): Update value.
  13806. (BB_LOOP_CONTROL_EXPR): Define.
  13807. (BB_CONTROL_ENTRY): Update value.
  13808. * tree-cfg.c (make_for_stmt_blocks): Flag header blocks withh
  13809. BB_LOOP_CONTROL_EXPR.
  13810. (make_while_stmt_blocks): Ditto.
  13811. (make_do_stmt_blocks): Ditto.
  13812. (tree_delete_bb): Update annotations in the loop entry block when
  13813. removing one of the loop expression blocks.
  13814. * tree-dfa.c (tree_find_varrefs): Disregard empty blocks.
  13815. (find_refs_in_stmt): Handle all the loop expression blocks in
  13816. FOR_STMT and DO_STMT nodes.
  13817. (find_refs_in_expr): Change first argument to tree *. Update all
  13818. callers.
  13819. Force all references to be definitions when the expression is not
  13820. in SIMPLE form.
  13821. Also create references for compound variables and array references.
  13822. Not just their individual components.
  13823. Always use the original parent expression when making recursive
  13824. calls.
  13825. (create_ref): Add new argument operand_p. Update all callers.
  13826. (remove_tree_ann): New function.
  13827. (dump_varref): Don't assume that the referenced symbol is a _DECL
  13828. node.
  13829. * tree-flow.h (treeref_common): Add field operand_p.
  13830. (VARREF_OPERAND_P): Define.
  13831. (BB_EMPTY_P): Define.
  13832. (remove_tree_ann): Declare.
  13833. (create_ref): Add new argument operand_p.
  13834. * tree-simple.c (get_base_symbol): New function.
  13835. * tree-simple.h (get_base_symbol): Declare.
  13836. * tree-ssa-ccp.c (visit_assignment): Call it.
  13837. (ssa_ccp_substitute_constants): Use VARREF_OPERAND_P to replace
  13838. values into the expression.
  13839. (evaluate_expr_for): Ditto.
  13840. Do not try to evaluate the expression if the reference is not of
  13841. the same type as the expression.
  13842. After evaluation, restore the expression to its original form.
  13843. * tree-ssa-pre.c (insert_occ_in_preorder_dt_order_): Update calls
  13844. to create_ref.
  13845. (finalize_): Ditto.
  13846. (expr_phi_insertion): Ditto.
  13847. * tree-ssa.c (tree_build_ssa): Ditto.
  13848. (insert_phi_terms): Ditto.
  13849. (delete_ssa): Call remove_tree_ann.
  13850. 2002-08-15 Diego Novillo <dnovillo@redhat.com>
  13851. * c-pretty-print.c: Move extern definitions to diagnostic.h.
  13852. (print_c_node_brief): New function.
  13853. (debug_c_node_brief): New function.
  13854. (debug_c_node): Add option for showing brief versions of statement
  13855. nodes. Update all callers.
  13856. (print_declaration): Ditto.
  13857. * c-simplify.c (simplify_function_tree): Add newline to debug
  13858. output.
  13859. * c-tree.h (print_c_node_brief): Declare.
  13860. (debug_c_node_brief): Declare.
  13861. * tree-cfg.c: Call print_c_node_brief in debugging otuput.
  13862. * tree-mudflap.c (dump_c_node): Remove extern declaration.
  13863. (mf_varname_tree): Update call to dump_c_node.
  13864. 2002-08-15 Daniel Berlin <dberlin@dberlin.org>
  13865. * tree-cfg.c (find_expr_in_tree_helper): Renamed from find_expr_in_tree.
  13866. (find_expr_in_tree): Redone.
  13867. 2002-08-15 Daniel Berlin <dberlin@dberlin.org>
  13868. * tree-cfg.c (insert_before_ctrl_stmt): Fix insertion for various
  13869. parts of for loop.
  13870. * tree-ssa-pre.c (finalize_1): Set EXPR_STMT type to type of
  13871. expression in it.
  13872. 2002-08-14 Frank Ch. Eigler <fche@redhat.com>
  13873. * gcc.c (LINK_COMMAND_SPEC): Tweak placement of %(mflib).
  13874. 2002-08-14 Diego Novillo <dnovillo@redhat.com>
  13875. * tree-simple.h (is_simple_decl_stmt): Declare.
  13876. 2002-08-13 Frank Ch. Eigler <fche@redhat.com>
  13877. * gcc.c (MFWRAP_SPEC, MFLIB_SPEC): New macros, splitting MFLIB_SPEC.
  13878. (mfwrap_spec, mflib_spec): Define corresponding vars.
  13879. (static_specs): Define correponding spec aliases.
  13880. (LINK_COMMAND_SPEC): Include -fmudflap refs to new spec aliases.
  13881. (cpp_unique_options): Move -fmudflap MFCPP_SPEC clause here.
  13882. (cc1_options): Move -fmudflap MFCC1_SPEC clause here.
  13883. (MFCC1_SPEC, MFCPP_SPEC, MFLIB_SPEC): Remove macros and uses.
  13884. 2002-08-13 Graydon Hoare <graydon@redhat.com>
  13885. * tree-mudflap.c (mf_build_check_statement_for): Factor code out of
  13886. mx_xfn_indirect_ref for use in ARRAY_REF case.
  13887. (mf_build_check_statement_for): Check size of underlying object
  13888. rather than size of pointer.
  13889. (mx_xfn_indirect_ref): Check ARRAY_REF expressions.
  13890. (mf_offset_expr_of_array_ref): New function to calculate array ref
  13891. offsets.
  13892. 2002-08-13 Diego Novillo <dnovillo@redhat.com>
  13893. * tree-simple.c (is_simple_condexpr): Update comment.
  13894. * tree-ssa-ccp.c (ssa_ccp_substitute_constants): Add debugging code.
  13895. 2002-08-12 Jason Merrill <jason@redhat.com>
  13896. * c-typeck.c (build_component_ref): Don't add a NON_LVALUE_EXPR
  13897. in C99 mode.
  13898. * c-simplify.c (simplify_expr): Always simplify. Loop if *expr_p
  13899. changed.
  13900. (simplify_addr_expr): Just replace *expr_p if we have a '&*'.
  13901. * tree-simple.c (is_simplifiable_builtin): Add more tree codes.
  13902. 2002-08-11 Diego Novillo <dnovillo@redhat.com>
  13903. * c-simplify.c: Fix typo. Substitute CHECKING with ENABLE_CHECKING.
  13904. * tree-cfg.c: Ditto.
  13905. * tree-dfa.c: Ditto.
  13906. * tree-ssa-ccp.c: Ditto.
  13907. * tree-ssa.c: Ditto.
  13908. 2002-08-11 Diego Novillo <dnovillo@redhat.com>
  13909. * tree-dfa.c (find_refs_in_expr): Use the given ref_type for some unary
  13910. expressions.
  13911. (create_ref): Insert ghost definitions at the beginning of the
  13912. basic block.
  13913. (find_expr_in_tree): Ignore IDENTIFIER_NODE.
  13914. * tree-flow.h (treeref_common): Move the id field to the end of the
  13915. structure.
  13916. (IS_GHOST_DEF): Redefine to return non zero for definitions
  13917. without an associated expression in basic block 0.
  13918. * tree-ssa-ccp.c (tree_ssa_ccp): Use last_basic_block to allocate
  13919. executable_blocks.
  13920. (visit_expression): Set the lattice value for ghost definitions to
  13921. VARYING.
  13922. (examine_flow_edges): Update comments.
  13923. * tree-ssa.c (tree_build_ssa): Create ghost definitions in basic
  13924. block 0.
  13925. (insert_phi_terms): Don't ignore ghost definitions.
  13926. * c-simplify.c (simplify_function_tree): Return 0 if the function's
  13927. body is not a COMPOUND_STMT.
  13928. Return 0 if simplification failed.
  13929. (simplify_expr): Change to return int. Return non zero if
  13930. simplification was successful.
  13931. (c_simplify_expr): Add default case to avoid compile time warnings.
  13932. (create_tmp_alias_var): Reformat comment.
  13933. * tree-simple.h (simplify_expr): Change return type to int.
  13934. * c-simplify.c: Guard consistency checks with #if defined CHECKING
  13935. everywhere.
  13936. * tree-cfg.c: Ditto.
  13937. * tree-dfa.c: Ditto.
  13938. * tree-ssa-ccp.c: Ditto.
  13939. * tree-ssa.c: Ditto.
  13940. * c-simplify.c: Include hard-reg-set.h, basic-block.h and
  13941. tree-flow.h.
  13942. (mark_not_simple_r): New function.
  13943. (simplify_expr): Temporarily mark VA_ARG_EXPR and BIT_FIELD_REF
  13944. trees as not simplifiable.
  13945. (simplify_call_expr): If the builtin cannot be simplified, flag it.
  13946. * Makefile.in (c-simplify.o): Update dependencies.
  13947. * tree-dfa.c (create_ref): Variable references inside
  13948. non-simplifiable expressions are always considered definitions.
  13949. * tree-flow.h (TF_NOT_SIMPLE): New flag.
  13950. * tree-simple.c (is_simplifiable_builtin): Update comments.
  13951. * c-pretty-print.c (dump_c_node): Unparse anonymous structures and
  13952. unions.
  13953. Change rendering for SAVE_EXPR and BIT_FIELD_REF.
  13954. * Makefile.in (tree-mudflap.o, tree-nomudflap.o): Add.
  13955. 2002-08-11 Frank Ch. Eigler <fche@redhat.com>
  13956. Prototype -fmudflap support.
  13957. * Makefile.in (C_AND_OBJC_OBJS): Add tree-mudflap.o.
  13958. (OBJS): Add tree-nomudflap.o.
  13959. * flags.h (flag_mudflap): New flag.
  13960. * toplev.c: Map "-fmudflap" to that flag.
  13961. * c-decl.c (c_expand_body): Call mudflap_c_function if flag_mudflap.
  13962. * c-objc-common.c (c_objc_common_finish_file): Add mudflap hook.
  13963. * varasm.c (make_decl_rtl): Add mudflap hook.
  13964. (output_constant_def_contents): Ditto.
  13965. * tree-mudflap.c: New file: implement mudflap instrumentation.
  13966. * tree-nomudflap.c: New file: stub functions for non-C frontends.
  13967. * tree-mudflap.h: New file: define exported functions.
  13968. * gcc.c (MFLIB_SPEC, MFCC1_SPEC, MFCPP_SPEC): Add general
  13969. -fmudflap spec mappings.
  13970. * c-simplify.c (simplify_stmt): Stub: handle CLEANUP_STMT nodes.
  13971. * tree-dfa.c (find_refs_in_stmt): Ditto.
  13972. * c-pretty-print.c (dump_c_node): Ditto.
  13973. (print_declaration): Handle "extern" decls. Handle arrays with
  13974. indefinite sizes.
  13975. * tree-simple.h (is_simple_stmt, is_simple_compstmt): Remove decls.
  13976. 2002-08-11 Jason Merrill <jason@redhat.com>
  13977. * c-simplify.c (simplify_self_mod_expr): Unshare the lhs before
  13978. using it again.
  13979. (simplify_compound_lval): Don't unshare.
  13980. * c-simplify.c (c_simplify_expr): Check statement_code_p.
  13981. * c-simplify.c (maybe_fixup_loop_cond): Move to cp/cp-simplify.c.
  13982. (simplify_for_stmt): Don't call it.
  13983. (simplify_while_stmt): Don't call it.
  13984. 2002-08-11 Diego Novillo <dnovillo@redhat.com>
  13985. * c-simplify.c (simplify_compound_lval): Use mostly_copy_tree_r.
  13986. 2002-08-09 Jason Merrill <jason@redhat.com>
  13987. * langhooks-def.h: Replace the simplify_function_tree hook
  13988. with a simplify_expr hook.
  13989. * langhooks.h: Likewise.
  13990. * langhooks.c: Replace lhd_simplify_function_tree with
  13991. lhd_simplify_expr.
  13992. * c-lang.c (LANG_HOOKS_SIMPLIFY_FUNCTION_TREE): Don't define.
  13993. (LANG_HOOKS_SIMPLIFY_EXPR): Define.
  13994. * c-decl.c (c_expand_body): De-hook simplify_function_tree.
  13995. * c-common.h: Declare c_simplify_expr.
  13996. * c-simplify.c (simplify_function_tree): Rename from
  13997. c_simplify_function_tree. Call simplify_expr instead of
  13998. simplify_stmt.
  13999. (c_simplify_expr): Split out from...
  14000. (simplify_expr): ...here. No longer static. Call langhook.
  14001. (is_simple_decl_stmt): Move here from tree-simple.c.
  14002. * tree-simple.c: Don't include c-tree.h.
  14003. (is_simple_stmt, is_simple_compstmt): Remove.
  14004. (is_simple_decl_stmt): Move to c-simplify.c.
  14005. * tree.h: Declare simplify_function_tree.
  14006. * tree-simple.h: Declare simplify_expr, add_tree.
  14007. * tree-simple.c (rationalize_compound_expr): New fn.
  14008. 2002-08-07 Diego Novillo <dnovillo@redhat.com>
  14009. * basic-block.h (EDGE_TRUE_VALUE): Define.
  14010. (EDGE_FALSE_VALUE): Define.
  14011. * tree-cfg.c: Include c-tree.h.
  14012. (make_for_stmt_edges): Call simple_cst_equal to determine infinite
  14013. and zero iteration loops.
  14014. Set EDGE_TRUE_VALUE and EDGE_FALSE_VALUE to edges coming out of
  14015. predicate block.
  14016. (make_while_stmt_edges): Ditto.
  14017. (make_do_stmt_edges): Ditto.
  14018. (make_if_stmt_edges): Set EDGE_TRUE_VALUE and EDGE_FALSE_VALUE to
  14019. edges coming out of predicate block.
  14020. * c-simplify.c (simplify_compound_lval): Unshare the compound
  14021. reference before simplification.
  14022. * tree-cfg.c (insert_before_ctrl_stmt): Call print_c_node instead of
  14023. print_node_brief.
  14024. (insert_before_normal_stmt): Ditto.
  14025. (insert_after_ctrl_stmt): Ditto.
  14026. (insert_after_normal_stmt): Ditto.
  14027. (insert_after_loop_body): Ditto.
  14028. (replace_expr_in_tree): Ditto.
  14029. (tree_dump_bb): Ditto.
  14030. * tree-dfa.c: Include c-tree.h
  14031. (next_varref_id): New global variable.
  14032. (tree_find_varrefs): Initialize it to 0.
  14033. (create_ref): Increment it after creating a new reference. Store
  14034. it in ref.common.id.
  14035. Add the new reference to the list of references for the containing
  14036. expression.
  14037. (dump_varref): Show the reference ID.
  14038. * tree-flow.h (treeref_common): Add field 'id'.
  14039. (VARREF_ID): Define.
  14040. * tree-dump.c (dump_files): Re-order dump files.
  14041. * tree.h (tree_dump_index): Ditto.
  14042. * tree-optimize.c (optimize_function_tree): Remove blank lines.
  14043. * tree-simple.c: Remove unary operator '!' from grammar.
  14044. * tree-flow.h (tree_ann_def): Add field 'flags'.
  14045. (TF_FOLD): Define.
  14046. (TREE_ANN): Re-define into an lvalue.
  14047. (BB_FOR_STMT): Ditto.
  14048. (TREE_CURRDEF): Ditto.
  14049. (next_varref_id): Declare.
  14050. * tree-ssa-ccp.c: Include tree-simple.h
  14051. (ssa_edges): Convert sbitmap into varray_type. Update all uses.
  14052. (decl_map): Remove.
  14053. (SSA_NAME): Use VARREF_ID instead of DECL_UID.
  14054. (visit_assignment): New function.
  14055. (evaluate_expr_for): New function.
  14056. (dump_lattice_value): New function.
  14057. (tree_ssa_ccp): Add debugging dumps.
  14058. Remove #if 0 code everywhere.
  14059. (visit_phi_node): Add debugging dumps.
  14060. Also visit PHI arguments.
  14061. Remove basic block argument
  14062. (visit_expression): Re-implement.
  14063. (examine_flow_edges): Add debugging dumps.
  14064. (ssa_ccp_substitute_constants): Add debugging dumps.
  14065. Update comments.
  14066. Mark and fold expressions with substituted constants.
  14067. * tree-ssa.c (search_fud_chains): Don't check if BB_REFS(bb) is
  14068. empty before iterating.
  14069. Add comment explaining how we chain PHI node arguments to their
  14070. originating basic block.
  14071. * Makefile.in (tree-cfg.o, tree-dfa.o, tree-ssa-ccp.o): Update
  14072. dependencies.
  14073. 2002-07-29 Daniel Berlin <dberlin@dberlin.org>
  14074. * tree-ssa-pre.c (tree_perform_ssapre): Ben forgot to add a
  14075. dump_begin call when he removed the before dump.
  14076. 2002-07-24 Daniel Berlin <dberlin@dberlin.org>
  14077. * tree-alias-ecr.c (ECR_new_with_type): Use correct number in mapping.
  14078. 2002-07-23 Daniel Berlin <dberlin@dberlin.org>
  14079. * c-simplify.c (simplify_for_stmt): Deep copy the result of the
  14080. tail_expression, so it's unshared.
  14081. 2002-07-23 Daniel Berlin <dberlin@dberlin.org>
  14082. * tree-flow.h: Add prototype for create_alias_vars.
  14083. * tree-alias-steen.c (display_points_to_set): New function.
  14084. (init_alias_vars): Display points to sets when we are done.
  14085. * disjoint-set.h (disjoint_set_def): ptr_alias to ECR_def so that
  14086. we mark parent properly.
  14087. 2002-07-24 Diego Novillo <dnovillo@redhat.com>
  14088. * Makefile.in (GTFILES): Move tree-alias-type.[ch],
  14089. tree-alias-ecr.[ch], tree-alias-steen.[ch] from ...
  14090. * c-config-lang.in (gtfiles): ... here.
  14091. * tree-simple.c (is_simplifiable_builtin): Replace
  14092. BUILT_IN_VARARGS_START with BUILT_IN_VA_START.
  14093. 2002-07-23 Andreas Jaeger <aj@suse.de>
  14094. * tree-ssa-pre.c (hash_expr_tree): Remove.
  14095. * c-call-graph.c (write_dtd): Remove.
  14096. * tree-ssa.c (delete_refs): Remove.
  14097. 2002-07-23 Andreas Jaeger <aj@suse.de>
  14098. * gengtype.c (open_base_files): Add tree.h.
  14099. * tree-alias-type.h: Remove inclusion of tree.h.
  14100. * tree-alias-steen.c: Include tree.h.
  14101. Add prototype for create_fun_alias_var_ptf.
  14102. * tree-alias-ecr.c: Add prototype for ECR_add_pending.
  14103. * tree-ssa-pre.c (calculate_preorder): Remove unused variables.
  14104. * tree-simple.c: Include expr.h and rtl.h for prototypes.
  14105. * tree-optimize.c: Include tree-alias-steen.h for prototypes.
  14106. * Makefile.in (tree-optimize.o): Add tree-alias-steen.h.
  14107. (tree-simple.o): Add expr.h and rtl.h.
  14108. (tree-alias-steen.o): Add tree.h.
  14109. * diagnostic.h: Add declaration of debug_output_buffer.
  14110. * c-call-graph.c (construct_call_graph): Make static to follow
  14111. declaration.
  14112. (construct_call_graph): Use #if 0 instead of C++ comments to
  14113. disable code.
  14114. 2002-07-20 Andreas Jaeger <aj@suse.de>
  14115. * doc/invoke.texi (Option Summary): Fix syntax.
  14116. 2002-07-19 Jason Merrill <jason@redhat.com>
  14117. * c-simplify.c (simplify_return_stmt): Do simplify a returned
  14118. expression in a void function.
  14119. * c-simplify.c (simplify_stmt_expr): Handle C++ return semantics.
  14120. 2002-07-19 Jason Merrill <jason@redhat.com>
  14121. * c-pretty-print.c (dump_c_node) [TARGET_EXPR]: Handle.
  14122. [COND_EXPR]: Print a returned expression in a void function.
  14123. 2002-07-19 Ben Elliston <bje@redhat.com>
  14124. * tree-ssa-pre.c (tree_perform_ssapre): Don't dump the original
  14125. tree before applying this optimisation.
  14126. * flags.h (flag_dump_tree_all_ssa): New flag.
  14127. * toplev.c (flag_dump_tree_all_ssa): New flag.
  14128. (f_options): Add "dump-tree-all-ssa" option.
  14129. (process_options): Process flag_dump_tree_all_ssa.
  14130. * tree.h (dump_enable_all_ssa): Declare.
  14131. * tree-dump.c (dump_enable_all_ssa): New function.
  14132. * doc/invoke.texi (Option Summary): Add -fdump-tree-all-ssa and
  14133. -fdump-tree-ssapre options.
  14134. (Debugging Options): Describe in more detail.
  14135. * c-simplify.c (c_simplify_function_tree): Dump the original tree
  14136. only if a TDI_original dump is requested, rather than TDI_simple.
  14137. * tree-dump.c (dump_begin): Include phase number in dump filename.
  14138. 2002-07-18 Ben Elliston <bje@redhat.com>
  14139. * tree-dump.c (dump_files): Rename "unparse" to "raw".
  14140. * tree.h (TDF_UNPARSE): Rename from this ..
  14141. (TDF_RAW): .. to this.
  14142. * tree-ssa-pre.c (tree_perform_ssapre): Use TDF_RAW and invert the
  14143. logical sense of this flag.
  14144. * tree-ssa-ccp.c (tree_ssa_ccp): Likewise.
  14145. * c-simplify.c (c_simplify_function_tree): Likewise.
  14146. 2002-07-18 Daniel Berlin <dberlin@dberlin.org>
  14147. * tree-ssa-pre.c (calculate_preorder): New function.
  14148. (tree_perform_ssapre): Use it, rather than
  14149. flow_compute_preorder_tranversal, which seems to not do
  14150. what we want.
  14151. 2002-07-18 Daniel Berlin <dberlin@dberlin.org>
  14152. * tree-alias-type.c: Move gt-tree-alias-type include to end of file.
  14153. * tree-alias-steen.c: Move gt-tree-alias-steen include to end of file.
  14154. 2002-07-18 Daniel Berlin <dberlin@dberlin.org>
  14155. * gengtype.c (get_base_file_bitmap): Mark tree-alias-* and
  14156. disjoint-set* as c/c++/objc files only.
  14157. * Makefile.in (gt-tree-alias-type.h): Add.
  14158. (tree-alias-type.o): Add dependency on gt-tree-alias-type.h.
  14159. * tree-alias-type.c: Include gt-tree-alias-type.h.
  14160. (alias_bottom): Add a GTY marked version of alias_bottom here.
  14161. * tree-alias-type.h: Remove the GTY marker from alias_bottom.
  14162. 2002-07-17 Daniel Berlin <dberlin@dberlin.org>
  14163. * tree-alias-ecr.c (ECR_union_pending_sets): Only clear bitmap if
  14164. it's not NULL.
  14165. 2002-07-16 Jason Merrill <jason@redhat.com>
  14166. * c-simplify.c (add_tree): Build an EXPR_STMT immediately.
  14167. (convert_to_stmt_chain): Remove.
  14168. (simplify_stmt, simplify_for_stmt, simplify_while_stmt,
  14169. simplify_do_stmt, simplify_expr_wfl, tail_expression): Adjust.
  14170. 2002-07-17 Daniel Berlin <dberlin@dberlin.org>
  14171. * tree-alias-ecr.c: New file. Equivalence Class Representation.
  14172. * tree-alias-steen.c: New file. Steengaard Alias Analysis.
  14173. * disjoint-set.c: New file. Disjoint set data structure.
  14174. * tree-alias-type.c: New file. Alias types.
  14175. * c-simplify.c (create_tmp_alias_var): New function, like
  14176. create_tmp_var, but doesn't add it to the current binding.
  14177. * tree-simple.h: Prototype for create_tmp_alias_var.
  14178. * tree-optimize.c (build_tree_ssa): Create alias variables, if
  14179. requested.
  14180. * flags.h: Add flag_tree_points_to.
  14181. * toplev.c: Ditto.
  14182. * gengtype.c (open_base_files): Add disjoint-set.h,
  14183. tree-alias-ecr.h, tree-alias-type.h, tree-flow.h.
  14184. * Makefile.in (C_AND_OBJC_OBJS): Add disjoint-set.o,
  14185. tree-alias-ecr.o, tree-alias-type.o, tree-alias-steen.o.
  14186. (tree-alias-steen.o): Add dependencies.
  14187. (tree-alias-ecr.o): Ditto.
  14188. (tree-alias-type.o): Ditto.
  14189. (disjoint-set.o): Ditto.
  14190. 2002-07-10 Daniel Berlin <dberlin@dberlin.org>
  14191. Diego Novillo <dnovillo@redhat.com>
  14192. * Makefile.in (C_AND_OBJC_OBJS): Add tree-ssa-ccp.o
  14193. * flags.h (flag_tree_ssa_ccp): Declare.
  14194. * fold-const.c (eval_subst): Make extern.
  14195. * toplev.c (flag_tree_ssa_ccp): Define.
  14196. (f_options): Document -ftree-ssa-ccp.
  14197. * tree-dump.c (dump_files): Add -fdump-tree-ccp.
  14198. * tree-flow.h (tree_perform_ssapre): Move declaration ...
  14199. * tree-optimize.h: ... here.
  14200. (tree_ssa_ccp): Declare.
  14201. * tree-optimize.c (optimize_function_tree): Call tree_ssa_ccp.
  14202. * tree-ssa-ccp.c: New file.
  14203. * tree.c (next_decl_uid): Remove static declaration.
  14204. * tree.h (next_decl_uid): Declare.
  14205. (tree_dump_index): Add TDI_ccp.
  14206. * cp/Make-lang.in (CXX_C_OBJS): Add tree-ssa-ccp.o.
  14207. * doc/invoke.texi: Document -ftree-ssa-pre and -ftree-ssa-ccp.
  14208. 2002-07-09 Daniel Berlin <dberlin@dberlin.org>
  14209. s/varrays of refs/ref_list of refs/g
  14210. * tree-flow.h: Add ref_list structure.
  14211. Add prototypes for ref_list functions.
  14212. (FOR_EACH_REF, FOR_EACH_REF_REV): New macros to iterate through
  14213. ref lists.
  14214. * tree-cfg.c, tree-ssa.c, tree-ssa-pre.c: Update all uses.
  14215. * tree-dfa.c (create_ref_list): New function.
  14216. (delete_ref_list): Ditto.
  14217. (empty_ref_list): Ditto.
  14218. (add_ref_to_list_end): Ditto.
  14219. (add_ref_to_list_begin): Ditto.
  14220. (remove_ref_from_list): Ditto.
  14221. 2002-07-04 Diego Novillo <dnovillo@redhat.com>
  14222. * tree-simple.c (is_simplifiable_builtin): Don't simplify target
  14223. builtins.
  14224. 2002-07-03 Diego Novillo <dnovillo@redhat.com>
  14225. * c-simplify.c (simplify_decl_stmt): Unshare the
  14226. initializer nodes before simplification.
  14227. 2002-06-29 Aldy Hernandez <aldyh@quesejoda.com>
  14228. Diego Novillo <dnovillo@redhat.com>
  14229. * c-simplify.c (simplify_call_expr): Do not bail on all builtins.
  14230. (is_simple_call_expr): Same.
  14231. (simplify_addr_expr): New function.
  14232. (simplify_expr): Call it.
  14233. * tree-simple.c (is_simplifiable_builtin): New.
  14234. (is_simple_compound_lval): Do not bail on INDIRECT_REF.
  14235. * tree-simple.h: New prototype for is_simplifiable_builtin.
  14236. 2002-06-26 Daniel Berlin <dberlin@dberlin.org>
  14237. * tree-ssa.c (tree_build_ssa): Call free_dominance_info, not
  14238. free, on idom.
  14239. * tree-ssa-pre.c (compute_domchildren): Update to use new
  14240. dominance_info structure, rather than idom array.
  14241. (tree_perform_ssapre): Don't forget to free the dominance info.
  14242. s/VARRAY_FREE/VARRAY_CLEAR/g now that VARRAY's are ggc allocated.
  14243. 2002-06-24 Diego Novillo <dnovillo@redhat.com>
  14244. * tree-ssa.c (build_fud_chains): Use dominance_info instead of int *.
  14245. (search_fud_chains): Ditto.
  14246. Call get_immediate_dominator.
  14247. * tree-ssa-pre.c (a_dom_b): Call dominated_by_p.
  14248. (pre_idom): Change type to dominance_info. Update all uses.
  14249. (pre_doms): Remove. Update all uses.
  14250. 2002-06-20 Jason Merrill <jason@redhat.com>
  14251. Simplify DECL_STMT, CONSTRUCTOR and COMPOUND_LITERAL_EXPR.
  14252. * tree-simple.c (is_simple_decl_stmt): New fn.
  14253. (is_simple_constructor, is_simple_constructor_elt): New fns.
  14254. (is_simple_stmt, is_simple_unary_expr): Use them.
  14255. (is_simple_modify_expr): Accept an INIT_EXPR.
  14256. (is_simple_id): Don't allow a COMPOUND_LITERAL_EXPR.
  14257. (is_simple_unary_expr): Here either.
  14258. * c-simplify.c (simplify_decl_stmt, simplify_constructor): New fns.
  14259. (simplify_compound_literal_expr): New fn.
  14260. (simplify_stmt, simplify_expr): Use them.
  14261. (get_initialized_tmp_var): Use an INIT_EXPR.
  14262. (simplify_modify_expr): Accept an INIT_EXPR.
  14263. (simplify_for_stmt): Call simplify_decl_stmt.
  14264. (get_name): Don't crash if the decl is anonymous.
  14265. (tail_expression): New fn.
  14266. * tree-simple.h: Declare new fns.
  14267. * c-pretty-print.c (dump_c_node) [INIT_EXPR]: Print like MODIFY_EXPR.
  14268. (dump_c_node, op_prio): Handle COMPOUND_LITERAL_EXPR.
  14269. * c-simplify.c (simplify_expr_wfl): Only wrap pre and post stuff
  14270. that came from our subexpression.
  14271. (simplify_stmt): Restore stmts_are_full_exprs_p.
  14272. * c-simplify.c (simplify_expr_wfl): Bracket substatements with
  14273. FILE_STMTs rather than wrapping them in EXPR_WITH_FILE_LOCATION.
  14274. (simplify_stmt): Update lineno and input_filename from stmts.
  14275. (simplify_expr et al): Don't copy lineno between stmts. Don't pass
  14276. enclosing stmt down.
  14277. (update_line_number): Remove.
  14278. * c-simplify.c (simplify_expr_stmt): Don't check
  14279. is_last_stmt_of_scope.
  14280. (simplify_stmt_expr): Check it here. Set *expr_p to void_zero_node
  14281. instead of NULL_TREE.
  14282. (expr_has_effect): No need to deal with NULL exprs now.
  14283. (simplify_expr_wfl): Likewise.
  14284. 2002-06-18 Diego Novillo <dnovillo@redhat.com>
  14285. * c-simplify.c (strip_off_ending): Rename to remove_suffix.
  14286. Update callers.
  14287. (is_last_stmt_of_scope): New function.
  14288. (simplify_expr_stmt): Call it.
  14289. (stmt_has_effect): Ditto.
  14290. (c_simplify_function_tree): Update comment.
  14291. 2002-06-18 Jason Merrill <jason@redhat.com>
  14292. * c-simplify.c (maybe_fixup_loop_cond): New fn for C++ conditions.
  14293. (simplify_for_stmt, simplify_while_stmt): Use it.
  14294. * c-pretty-print.c (dump_c_node) [COMPONENT_REF]: Print "->" if
  14295. appropriate.
  14296. 2002-06-19 Jason Merrill <jason@redhat.com>
  14297. * c-simplify.c (simplify_stmt_expr): New fn.
  14298. (simplify_expr): Call it.
  14299. (stmt_expr_level): Remove.
  14300. (stmt_has_effect, c_simplify_function_tree): Remove refs.
  14301. (expr_has_effect): Deal with null expression.
  14302. (simplify_expr_wfl): If the subexpression is simplified away, drop
  14303. this one, too. Don't wrap statements.
  14304. * tree-simple.c (is_simple_unary_expr): Don't allow a STMT_EXPR.
  14305. * tree-inline.c (copy_tree_r): Clear the aux field in the copies.
  14306. 2002-06-17 Frank Ch. Eigler <fche@redhat.com>
  14307. * c-pretty-print.c (dump_c_node): Print pointer-type
  14308. integer constants as raw numbers with a "B" (bytes) suffix.
  14309. 2002-06-17 Jason Merrill <jason@redhat.com>
  14310. * c-simplify.c (simplify_stmt): Take a tree *.
  14311. (various): Adjust.
  14312. 2002-06-16 Daniel Berlin <dberlin@dberlin.org>
  14313. * c-simplify.c (get_name): New function.
  14314. (get_initialized_tmp_var): Use it to try to get a prefix for
  14315. create_tmp_var from the value we are initializing to.
  14316. (simplify_cond_expr): Add prefix for create_tmp_var.
  14317. (create_tmp_var): Add prefix argument.
  14318. * tree-simple.h: Change create_tmp_var prototype to match.
  14319. * tree-ssa-pre.c: Change create_tmp_var call.
  14320. 2002-06-15 Diego Novillo <dnovillo@redhat.com>
  14321. * Makefile.in (c-decl.o): Add dependency on langhooks.h
  14322. (c-simplify.o): Add dependency on flags.h, langhooks.h, toplev.h
  14323. and rtl.h.
  14324. * c-decl.c: Include langhooks.h.
  14325. (c_expand_body): Simplify the function. If it succeeds and
  14326. -ftree-ssa is enabled, call optimize_function_tree.
  14327. * c-simplify.c: Include flags.h, rtl.h and toplev.h.
  14328. (simplify_expr_stmt): New function.
  14329. (simplify_stmt): Call it.
  14330. * tree-optimize.c: Don't include langhooks.h.
  14331. (optimize_function_tree): Don't call lang_hooks.simplify_function_tree.
  14332. * c-decl.c (c_expand_body): Do not simplify nor optimize the
  14333. function if -fdisable-simple is given.
  14334. * c-simplify.c (simplify_expr): Use is_simple_addr_expr_arg when
  14335. simplifying ADDR_EXPR nodes.
  14336. * flags.h (flag_disable_simple): Declare.
  14337. * toplev.c (flag_disable_simple): Define.
  14338. (f_options): Document -fdisable-simple.
  14339. (process_options): Warn if -fdisable-simple is used with
  14340. optimization enabled.
  14341. * tree-simple.c (is_simple_addr_expr_arg): New function.
  14342. (is_simple_unary_expr): Call it.
  14343. * tree-simple.h (is_simple_addr_expr_arg): Declare.
  14344. * doc/invoke.texi: Document -fdisable-simple.
  14345. * c-pretty-print.c (dump_c_node): Handle DECL_STMT nodes inside
  14346. FOR_INIT_STMT.
  14347. * c-simplify.c (c_simplify_function_tree): Don't do anything if the
  14348. program had errors.
  14349. (simplify_stmt): Skip DECL_STMTs.
  14350. (simplify_for_stmt): Handle DECL_STMT nodes inside FOR_INIT_STMT.
  14351. (simplify_save_expr): New function.
  14352. (simplify_expr): Call it.
  14353. (tree_last_decl): Handle cases where DECL_STMTs are found before
  14354. the body of the function.
  14355. * tree-simple.c (is_simple_stmt): Handle DECL_STMT nodes inside
  14356. FOR_INIT_STMT.
  14357. (is_simple_compound_lval): Handle nodes wrapped in NON_LVALUE_EXPR.
  14358. 2002-06-14 Frank Ch. Eigler <fche@redhat.com>
  14359. * c-pretty-print.c (dump_c_node): Print more type qualifiers,
  14360. especially for pointers.
  14361. 2002-06-11 Diego Novillo <dnovillo@redhat.com>
  14362. * c-simplify.c: Remove folding markers.
  14363. (insert_before_first): Remove unused function.
  14364. * tree-cfg.c: Remove folding markers.
  14365. * tree-dfa.c: Ditto.
  14366. * tree-flow.h: Ditto.
  14367. * tree-optimize.c: Ditto.
  14368. * tree-optimize.h: Ditto.
  14369. * tree-simple.c: Ditto.
  14370. * tree-ssa.c: Ditto.
  14371. 2002-06-11 Jason Merrill <jason@redhat.com>
  14372. * c-simplify.c (add_tree): Don't deep-copy expressions.
  14373. (simplify_for_stmt): Only deep-copy pre_cond_s the first time.
  14374. Don't deep copy expr_chain.
  14375. 2002-06-10 Diego Novillo <dnovillo@redhat.com>
  14376. * tree-cfg.c (remove_bb_ann): Don't call VARRAY_FREE.
  14377. * tree-dfa.c (create_ref): Use sizeof (ref) instead of
  14378. refs->element_size.
  14379. * tree.h (struct tree_common): Skip field 'aux' from GC type
  14380. information.
  14381. * tree-optimize.c (optimize_function_tree): Don't call
  14382. VARRAY_REF.
  14383. * tree-ssa.c (insert_phi_terms): Ditto.
  14384. (delete_refs): Ditto.
  14385. * c-simplify.c (simplify_array_ref): Ditto.
  14386. * simple-break-elim.c: Disable whole file.
  14387. * simple-goto-elim.c: Disable whole file.
  14388. 2002-06-10 Jason Merrill <jason@redhat.com>
  14389. * c-simplify.c (simplify_switch_stmt): Let simplify_expr handle
  14390. post-effects. Reorder.
  14391. (simplify_if_stmt): Likewise. Don't build redundant comparison.
  14392. (simplify_do_stmt, simplify_while_stmt): Likewise.
  14393. (simplify_for_stmt): Likewise. Remove POST_P parm.
  14394. (simplify_stmt): Adjust.
  14395. (insert_before_first): #if 0, no longer used.
  14396. * c-pretty-print.c (dump_c_node): Print FIX_TRUNC_EXPR, FLOAT_EXPR
  14397. et al as casts. Add parens as needed.
  14398. * tree-simple.c (is_union_based_ref): New fn.
  14399. (is_simple_min_lval): Use it. Rename from is_simple_arraybase.
  14400. (is_simple_arrayref): Adjust. Use loop instead of recursion.
  14401. (is_simple_compref): Likewise.
  14402. (is_simple_compref_lhs): Remove.
  14403. * tree-simple.h: Adjust.
  14404. * c-simplify.c (simplify_array_ref): Adjust.
  14405. (simplify_component_ref): Adjust.
  14406. * c-simplify.c (simplify_expr_common): Tweak ordering.
  14407. (get_initialized_tmp_var): Let simplify_expr handle post-effects.
  14408. * tree-simple.c (is_simple_stmt): Accept an rhs for a return expr.
  14409. * c-simplify.c (simplify_boolean_expr): Avoid redundant tests.
  14410. Give the temp the appropriate type for a boolean value, and
  14411. reconvert at the end.
  14412. * c-simplify.c (simplify_self_mod_expr): Don't duplicate side-effects.
  14413. * c-simplify.c (simplify_return_stmt): Accept a SIMPLE rhs.
  14414. Just hand off to simplify_expr.
  14415. * c-simplify.c (get_initialized_tmp_var): New fn.
  14416. (simplify_expr_common): Use it. Handle post-effects internally if
  14417. POST_P is NULL.
  14418. (is_simple_tmp_var): Rename from simple_tmp_var_p.
  14419. * tree-simple.h: Adjust.
  14420. 2002-06-09 Diego Novillo <dnovillo@redhat.com>
  14421. * c-simplify.c (simplify_return_stmt): Update folding markers.
  14422. (build_addr_expr): Ditto.
  14423. * langhooks.h (struct langhooks): Document simplify_function_tree
  14424. hook.
  14425. 2002-06-09 Jason Merrill <jason@redhat.com>
  14426. * c-simplify.c (simplify_expr_common): Handle creating both lvalue
  14427. and rvalue temps. Add new parameter to specify which.
  14428. (simplify_expr): Now just a wrapper.
  14429. (simplify_lvalue_expr): Likewise.
  14430. (simplify_expr_either): New wrapper.
  14431. (simplify_component_ref): Use it instead of simplify_lvalue_expr.
  14432. * c-pretty-print.c (debug_c_tree): Add a trailing newline.
  14433. (debug_c_node): Likewise.
  14434. * gdbinit.in (pct): New macro, calls debug_c_tree.
  14435. 2002-06-08 Jason Merrill <jason@redhat.com>
  14436. * tree-simple.c (is_simple_unary_expr): Only allow the address of
  14437. a varname.
  14438. (is_simple_id): Allow STRING_CST.
  14439. * c-simplify.c (simplify_expr_common): Split out from simplify_expr.
  14440. Do simplify ADDR_EXPR.
  14441. (simplify_lvalue_expr): Use it and build_addr_expr. Take
  14442. simple_test_f.
  14443. (simplify_modify_expr): Adjust.
  14444. (build_addr_expr): New fn.
  14445. (simplify_array_ref): Use simplify_lvalue_expr.
  14446. (simplify_component_ref): Likewise.
  14447. * tree-simple.c (is_simple_rhs): Remove condexpr rule.
  14448. (is_simple_compref_lhs): Remove &ID.idlist rule.
  14449. (is_simple_relop): New fn.
  14450. (is_simple_binary_expr, is_simple_condexpr): Use it.
  14451. * tree-simple.h: Declare it.
  14452. * c-simplify.c (create_tmp_var): Refuse to create an array temp.
  14453. (simple_tmp_var_p): New fn.
  14454. (simplify_lvalue_expr): Use it; make sure we don't return a temp.
  14455. * tree-simple.h: Declare it.
  14456. * c-pretty-print.c (dump_c_node) [ARRAY_REF]: Wrap array in parens
  14457. as needed.
  14458. [COMPONENT_REF]: Likewise.
  14459. [POINTER_TYPE]: Fix pointer-to-function handling.
  14460. [ARRAY_TYPE]: Don't try to print an unknown dimension.
  14461. * tree-simple.c (is_simple_arraybase): New function.
  14462. (is_simple_arrayref): Use it to check the array base again.
  14463. * tree-simple.h: Add declaration.
  14464. * c-simplify.c (simplify_array_ref): Do simplify the base.
  14465. * expr.c (expand_expr): First make sure the type has a size.
  14466. 2002-06-07 Jason Merrill <jason@redhat.com>
  14467. * cppexp.c (num_equality_op): Use a temporary variable to work
  14468. around gcc 3.0.4 bug.
  14469. 2002-06-05 Diego Novillo <dnovillo@redhat.com>
  14470. * Makefile.in (BOOT_CFLAGS): Remove -ftree-ssa.
  14471. * c-decl.c (c_expand_body): Call optimize_function_tree if tree SSA
  14472. is enabled.
  14473. * c-lang.c (LANG_HOOKS_SIMPLIFY_FUNCTION_TREE): Define.
  14474. * c-simplify.c (simplify_tree): Rename to c_simplify_function_tree.
  14475. Update all callers.
  14476. Dump function body before and after simplification if
  14477. -fdump-tree-simple is used.
  14478. (simplify_expr): Document FIXME for simplification of BIT_FIELD_REF
  14479. nodes.
  14480. * c-tree.h (simplify_tree): Rename to c_simplify_function_tree.
  14481. * langhooks-def.h (LANG_HOOKS_SIMPLIFY_FUNCTION_TREE): Define
  14482. (LANGHOOKS_INITIALIZER): Add LANG_HOOKS_SIMPLIFY_FUNCTION_TREE.
  14483. (lhd_simplify_function_tree): Declare.
  14484. * langhooks.c (lhd_simplify_function_tree): New function.
  14485. * langhooks.h (lang_hooks): Add simplify_function_tree function
  14486. pointer.
  14487. * toplev.c (parse_options_and_default_flags): Set flag_tree_ssa to
  14488. 1 at optimization levels >= 1.
  14489. Revert to default warning when -Wuninitialized is used without -O.
  14490. * tree-cfg.c (tree_find_basic_blocks): Rename argument 't' to
  14491. 'fnbody'.
  14492. * tree-optimize.c: Include langhooks.h.
  14493. (optimize_tree): Rename to optimize_function_tree. Update all
  14494. users.
  14495. Rename argument 't' to 'fndecl'.
  14496. Call simplify langhook before building SSA.
  14497. (build_tree_ssa): Rename argument 't' to 'fndecl'.
  14498. Adjust call to tree_find_basic_blocks to pass body of the function.
  14499. * tree-optimize.h (optimize_tree): Rename to
  14500. optimize_function_tree.
  14501. * tree-simple.c (is_simple_unary_expr): Document FIXME on
  14502. BIT_FIELD_REF nodes.
  14503. * tree-ssa.c: Add whitespace.
  14504. * testsuite/lib/c-torture.exp: Remove -ftree-ssa flag.
  14505. 2002-06-03 Daniel Berlin <dberlin@dberlin.org>
  14506. * tree-cfg.c (insert_before_*): For insertion into FOR_INIT's, if
  14507. we have an expression statement, transform into a compound
  14508. expression.
  14509. Pick the right place to insert a statement by iterating until we
  14510. have a first_exec_stmt (first_non_decl_stmt) that is really the
  14511. first executable non decl statement.
  14512. (insert_after_*): Ditto.
  14513. 2002-06-03 Daniel Berlin <dberlin@dberlin.org>
  14514. * tree-ssa-pre.c: Update BB stuff to new basic block structure.
  14515. Add some comments throughout (more coming, particularly describing
  14516. the algorithm, rather than the implementation).
  14517. (free_expr_info): Free refs as well.
  14518. (defs_y_dom_x): Handle unary expressions as well.
  14519. (insert_euse_in_preorder_dt_order_1): Use block of ref, not block
  14520. of statement.
  14521. Don't insert exit blocks if we hit them before hitting an
  14522. occurrence (it's pointless).
  14523. (rename_2): Return set of phi operands we touched, don't forget to
  14524. free VARRAY's we allocated.
  14525. (rename_1): Correct downsafety computation. Now get exact same
  14526. results as Open64.
  14527. Correct setting of has_real_use.
  14528. (finalize_1): Fix up insertion.
  14529. (code_motion): Fix up insertion.
  14530. * tree-dfa.c (dump_varref): Improve dumping of expression
  14531. references.
  14532. 2002-06-03 Diego Novillo <dnovillo@redhat.com>
  14533. * tree-cfg.c (delete_bb): Rename to tree_delete_bb. Update callers.
  14534. (tree_find_basic_blocks): Initializer last_basic_block.
  14535. (create_bb): Update last_basic_block after creating a new block.
  14536. (tree_cleanup_cfg): Delete unreachable blocks by traversing the
  14537. linked list, not the array. Update comments.
  14538. (delete_bb): Update comments.
  14539. (tree_dump_cfg): Also show last_basic_block.
  14540. * tree-ssa.c (tree_build_ssa): Use last_basic_block instead of
  14541. n_basic_blocks to allocate dominator arrays.
  14542. (insert_phi_terms): Ditto.
  14543. (search_fud_chains): User FOR_EACH_BB to look for dominator
  14544. children.
  14545. 2002-05-29 Diego Novillo <dnovillo@redhat.com>
  14546. * tree-cfg.c (tree_find_basic_blocks): Set next_bb and prev_bb for
  14547. ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR.
  14548. (create_bb): Set flag BB_NEW for every newly created block.
  14549. Call link_block to add the new block to the linked list.
  14550. (tree_split_bb): Traverse basic blocks using FOR_EACH_BB.
  14551. (make_goto_stmt_edges): Ditto.
  14552. (remove_unreachable_blocks): Add reminder comment to stop
  14553. compacting the basic block array every time a block is deleted.
  14554. (delete_cfg): Traverse basic blocks using FOR_EACH_BB.
  14555. (tree_dump_bb): Ditto.
  14556. (tree_dump_cfg): Ditto.
  14557. (tree_cfg2dot): Ditto.
  14558. * tree-dfa.c (tree_find_varrefs): Ditto.
  14559. (create_tree_ann): Ditto.
  14560. (get_fcalls): Ditto.
  14561. (find_declaration): Ditto.
  14562. * tree-ssa.c (tree_build_ssa): Ditto.
  14563. 2002-05-28 Diego Novillo <dnovillo@redhat.com>
  14564. * Makefile.in: Add -ftree-ssa to BOOT_CFLAGS.
  14565. 2002-05-27 Diego Novillo <dnovillo@redhat.com>
  14566. * c-decl.c (c_expand_body): Close dump file before simplifying the
  14567. function.
  14568. * c-pretty-print.c (dump_c_node): Handle COMPLEX_CST,
  14569. BIT_FIELD_REF, COMPLEX_EXPR, CONJ_EXPR, REALPART_EXPR,
  14570. IMAGPART_EXPR and VA_ARG_EXPR nodes.
  14571. Display all type casts, not just pointer casts.
  14572. (op_prio): Handle LROTATE_EXPR, RROTATE_EXPR, REALPART_EXPR and
  14573. IMAGPART_EXPR.
  14574. * c-simplify.c: Include "tree-inline.h"
  14575. (dump_file): New local variable.
  14576. (dump_flags): New local variable.
  14577. (stmt_expr_level): New local variable.
  14578. (simplify_tree): Open and close dump file if
  14579. -fdump-tree-simple-details is given.
  14580. Initialize stmt_expr_level.
  14581. (simplify_stmt): Dump statement before and after simplification if
  14582. -fdump-tree-simple-detail is given.
  14583. Unshare the expression of an EXPR_STMT before simplifying it.
  14584. Call simplify_return_stmt to handle RETURN_STMT nodes.
  14585. Do not simplify DECL_STMT nodes.
  14586. Call stmt_has_effect before re-chaining side effects.
  14587. (simplify_for_stmt): Do not return the simplified statement.
  14588. Update all callers.
  14589. Simplify FOR_BODY after the headers.
  14590. Unshare loop header expressions before simplification.
  14591. (simplify_while_stmt): Do not return the simplified statement.
  14592. Update all callers.
  14593. Simplify WHILE_BODY after the headers.
  14594. Unshare the loop header expression before simplification.
  14595. (simplify_do_stmt): Do not return the simplified statement. Update
  14596. all callers.
  14597. Unshare the loop header expression before simplification.
  14598. (simplify_if_stmt): Do not return the simplified statement. Update
  14599. all callers.
  14600. Simplify the condition expression before the clauses.
  14601. Unshare the condition expression before simplification.
  14602. (simplify_switch_stmt): Do not return the simplified statement.
  14603. Update all callers.
  14604. Simplify the switch expression before the body.
  14605. Unshare the switch expression before simplification.
  14606. (simplify_decl_stmt): Remove.
  14607. (simplify_expr): Remove argument 'needs_lvalue'.
  14608. Add argument 'stmt'.
  14609. Replace first argument 'expr' with a pointer to the
  14610. expression 'expr_p'.
  14611. Do not return the simplified expression.
  14612. Update all callers and uses.
  14613. Handle TRUTH_NOT_EXPR nodes. Simplify SAVE_EXPR nodes into a
  14614. SIMPLE id and remove the SAVE_EXPR node.
  14615. Do not simplify BIT_FIELD_REF nodes.
  14616. Remove code that tried to create new lvalues.
  14617. (simplify_array_ref): Replace first argument 'expr' with a pointer
  14618. to the expression 'expr_p'.
  14619. Do not return the simplified expression.
  14620. Add argument 'stmt'.
  14621. Update all callers and uses.
  14622. (simplify_self_mod_expr): Replace first argument 'expr' with a
  14623. pointer to the expression 'expr_p'.
  14624. Do not return the simplified expression.
  14625. Add argument 'stmt'.
  14626. Update all callers and uses.
  14627. Call simplify_lvalue_expr to simplify a copy of the LHS into an
  14628. lvalue for the new assignment.
  14629. Simplify the new binary expression.
  14630. (simplify_component_ref): Replace first argument 'expr' with a
  14631. pointer to the expression 'expr_p'.
  14632. Do not return the simplified expression.
  14633. Add argument 'stmt'.
  14634. Update all callers and uses.
  14635. (simplify_call_expr): Ditto.
  14636. (simplify_tree_list): Ditto.
  14637. (simplify_cond_expr): Ditto.
  14638. Build a replacement IF_STMT and call simplify_if_stmt() to process
  14639. it. Set the line number of the new statement from the statement
  14640. containing the original expression.
  14641. (simplify_modify_expr): Replace first argument 'expr' with a
  14642. pointer to the expression 'expr_p'.
  14643. Do not return the simplified expression.
  14644. Add argument 'stmt'.
  14645. Update all callers.
  14646. Call simplify_lvalue_expr to simplify the LHS of the assignment.
  14647. (simplify_boolean_expr): Replace first argument 'expr' with a
  14648. pointer to the expression 'expr_p'.
  14649. Do not return the simplified expression.
  14650. Add argument 'stmt'.
  14651. Update all callers.
  14652. Build a new IF_STMT and simplify it all at once by calling
  14653. simplify_if_stmt.
  14654. (simplify_compound_expr): Replace first argument 'expr' with a
  14655. pointer to the expression 'expr_p'.
  14656. Do not return the simplified expression.
  14657. Add argument 'stmt'.
  14658. Update all callers.
  14659. (simplify_expr_wfl): Ditto.
  14660. (simplify_lvalue_expr): New function.
  14661. (add_tree): Create a copy of each expression before adding it to
  14662. the list.
  14663. (deep_copy_node): Call copy_tree_r to copy expression nodes.
  14664. (stmt_has_effect): Return nonzero if the statement may be the last
  14665. statement of a statement expression body.
  14666. (mostly_copy_tree_r): New function.
  14667. * tree-dump.c (dump_options): Add 'details'.
  14668. * tree-simple.c: Update documentation about ADDRESSOF expressions.
  14669. (is_simple_stmt): Test for SIMPLE values when checking return
  14670. statements.
  14671. Accept all DECL_STMT nodes.
  14672. (is_simple_compstmt): Return nonzero if T is NULL. Do not test
  14673. DECL_STMT nodes
  14674. (is_simple_expr): Return nonzero if T is NULL.
  14675. (is_simple_rhs): Ditto.
  14676. (is_simple_modify_expr): Ditto.
  14677. (is_simple_modify_expr_lhs): Ditto.
  14678. (is_simple_binary_expr): Ditto.
  14679. (is_simple_cond_expr): Ditto.
  14680. (is_simple_unary_expr): Call STRIP_NOPS before testing T.
  14681. Always accept ADDR_EXPR nodes.
  14682. Always accept BIT_FIELD_REF nodes.
  14683. (is_simple_call_expr): Return nonzero if T is NULL.
  14684. (is_simple_const): Ditto.
  14685. (is_simple_val): Ditto.
  14686. (is_simple_compref): Ditto.
  14687. (is_simple_compref_lhs): Ditto.
  14688. (is_simple_cast): Ditto.
  14689. (is_simple_cast_op): Ditto.
  14690. (is_simple_id): Return nonzero if T is NULL. Allow identifiers
  14691. wrapped inside NON_LVALUE_EXPR and EXPR_WITH_FILE_LOCATION nodes.
  14692. Allow real and imaginary parts of a complex variable.
  14693. Allow compound literals.
  14694. (is_simple_arrayref): Allow arrays of complex types.
  14695. * tree.h (TDF_DETAILS): Define.
  14696. * cp/pt.c (tsubst_template_parms): Check that 'parms' is non-NULL
  14697. before calling TMPL_PARMS_DEPTH.
  14698. * doc/invoke.texi: Document -fdump-tree-simple-details.
  14699. 2002-05-10 Daniel Berlin <dberlin@dberlin.org>
  14700. * c-pretty-print.c (dump_c_node): Print "<unnamed whatever>" for
  14701. types, variables, etc that have no name, rather than printing
  14702. nothing.
  14703. Handle PMF's properly.
  14704. Print out structure initializers in a somewhat sensible way.
  14705. Print SAVE_EXPR () around SAVE_EXPRs.
  14706. (print_call_name): Handle EXPR_WITH_FILE_LOCATION.
  14707. 2002-05-09 Daniel Berlin <dberlin@dberlin.org>
  14708. * tree-dfa.c (dump_varref): Tree inlining generates variables with
  14709. no name. Don't crash on dumping varref's of them.
  14710. * tree-inline.c (expand_call_inline): Generate a proper STMT_EXPR
  14711. (it was missing COMPOUND_STMT).
  14712. 2002-05-08 Daniel Berlin <dberlin@dberlin.org>
  14713. s/varref_type/treeref_type/g
  14714. s/create_varref/create_ref/g
  14715. * tree-flow.h: Add EXPRPHI, EXPRUSE, EXPRKILL, EXPRINJ.
  14716. Add structures and macros for each.
  14717. Add tree_perform_ssapre prototype.
  14718. * Makefile.in (C_AND_OBJC_OBJS): Add tree-ssa-pre.o
  14719. (tree-ssa-pre.o): Add dependencies for tree-ssa-pre.o
  14720. * cp/Make-lang.in: Add tree-ssa-pre.o
  14721. * flags.h: Add flag_tree_ssa_pre.
  14722. * tree-ssa-pre.c: New file, SSA-PRE.
  14723. * toplev.c: Add flag_tree_ssa_pre.
  14724. (lang_independent_options): Add tree-ssa-pre.
  14725. * tree-dump.c (dump_files): Add ssapre dump.
  14726. * tree-optimize.c (optimize_tree): Do SSAPRE if requested.
  14727. * tree.h (dump_index): Add TDI_ssa_pre.
  14728. * tree-dfa.c (create_ref): Add support for creating the EXPR*'s refs.
  14729. (dump_varref): Add support for dumping EXPR* refs.
  14730. * tree-ssa.c (search_fud_chains): Add BB to VARDEF_PHI_CHAIN_BB.
  14731. 2002-05-07 Diego Novillo <dnovillo@redhat.com>
  14732. * c-pretty-print.c (op_prio): Handle ABS_EXPR.
  14733. Don't abort when the operand is not recognized.
  14734. (op_symbol): Don't abort when the operand is not recognized.
  14735. * c-simplify.c (simplify_expr): Remove 'const' qualifier from first
  14736. argument.
  14737. Do not copy incoming expression.
  14738. Exclude handling of MODIFY_EXPR, INIT_EXPR, SAVE_EXPR and binary
  14739. expression nodes.
  14740. (simplify_array_ref): Remove 'const' qualifier from first argument.
  14741. Do not copy the incoming expression.
  14742. (simplify_self_mod_expr): Ditto.
  14743. Do not simplify the first operand twice.
  14744. (simplify_component_ref): Remove 'const' qualifier from first
  14745. argument. Do not copy the incoming expression.
  14746. (simplify_call_expr): Ditto.
  14747. (simplify_tree_list): Ditto.
  14748. (simplify_cond_expr): Ditto.
  14749. (simplify_modify_expr): Ditto.
  14750. (simplify_boolean_expr): Ditto.
  14751. (simplify_compound_expr): Ditto.
  14752. (simplify_save_expr): Ditto.
  14753. (simplify_expr_wfl): Ditto.
  14754. (tree_build_scope): Re-write. Do nothing if block already contains
  14755. a scope. Use chainon to chain the body with the scope closing
  14756. node.
  14757. (deep_copy_node): Do not check for NULL nodes. Do not deep copy
  14758. declarations, types and constants.
  14759. 2002-05-06 Daniel Berlin <dberlin@dberlin.org>
  14760. * c-simplify.c (deep_copy_node): Don't copy DECL_STMT_DECL's.
  14761. 2002-05-06 Daniel Berlin <dberlin@dberlin.org>
  14762. * tree-simple.c (is_simple_compstmt): Don't post-initialize
  14763. statics or aggregate initializers.
  14764. * c-simplify.c (simplify_decl_stmt): Ditto.
  14765. 2002-05-06 Sebastian Pop <s.pop@laposte.net>
  14766. * Makefile.in (simple-break-elim.o, simple-goto-elim.o, tree-dchain.o):
  14767. Added.
  14768. * c-decl.c: Include tree-dchain.h
  14769. (c_expand_body): Add entry point to the goto, break elimination
  14770. after the simplification pass.
  14771. * simple-break-elim.c: New file.
  14772. * simple-goto-elim.c: New file.
  14773. * tree-dchain.h: New file.
  14774. * tree-dchain.c: New file.
  14775. 2002-05-02 Diego Novillo <dnovillo@redhat.com>
  14776. * c-simplify.c (simplify_expr): Constify first argument.
  14777. Always work on a copy of the input expression.
  14778. Do not simplify COMPOUND_LITERAL_EXPR nor CONSTRUCTOR nodes.
  14779. (simplify_array_ref): Constify first argument. Always work on a
  14780. copy of the input expression.
  14781. (simplify_self_mod_expr): Ditto.
  14782. (simplify_component_ref): Ditto.
  14783. (simplify_call_expr): Ditto.
  14784. (simplify_tree_list): Ditto.
  14785. (simplify_cond_expr): Ditto.
  14786. When building the THEN_CLAUSE and ELSE_CLAUSE for the new IF_STMT,
  14787. create a scope for them and simplify the scope, not the expression.
  14788. (simplify_modify_expr): Constify first argument. Always work on a
  14789. copy of the input expression.
  14790. (simplify_boolean_expr): Ditto.
  14791. (simplify_compound_expr): Ditto.
  14792. (simplify_save_expr): Ditto.
  14793. (simplify_expr_wfl): Ditto.
  14794. * tree-cfg.c (tree_find_basic_blocks): Update comments for
  14795. -fdump-tree-dot.
  14796. (tree_dump_cfg): Ditto.
  14797. * tree-dump.c (dump_files): Rename -fdump-tree-graphviz to
  14798. -fdump-tree-dot.
  14799. * tree-simple.c (is_simple_unary_expr): Do not handle &CONST
  14800. expressions.
  14801. Handle COMPOUND_LITERAL_EXPR and CONSTRUCTOR nodes.
  14802. (is_simple_const): Strip NOPS and handle &CONST expressions.
  14803. * tree.h (enum tree_dump_index): Remove references to GraphViz.
  14804. * doc/invoke.texi: Update documentation for -fdump-tree-dot.
  14805. 2002-05-02 Sebastian Pop <s.pop@laposte.net>
  14806. * c-pretty-print.c (dump_c_node): Don't print declarations
  14807. from the SCOPE_STMT_BLOCK, use the DECL_STMT instead.
  14808. 2002-04-30 Diego Novillo <dnovillo@redhat.com>
  14809. * c-pretty-print.c (NIY): Display an error string instead of aborting.
  14810. (op_prio): Add support for COMPOUND_EXPR, TRUTH_XOR_EXPR, MIN_EXPR,
  14811. MAX_EXPR and NON_LVALUE_EXPR.
  14812. For EXPR_WITH_FILE_LOCATION nodes, return the priority of
  14813. the internal node.
  14814. (op_symbol): Add support for TRUTH_XOR_EXPR.
  14815. * c-simplify.c (simplify_stmt): Only remove null statements that
  14816. have been nullified by simplification.
  14817. Call debug_tree() dump unhandled tree nodes.
  14818. (simplify_for_stmt): Always deep-copy PRE_COND_S before adding it
  14819. to PRE_P.
  14820. (simplify_expr): When simplifying a MODIFY_EXPR node into an
  14821. rvalue, return operand 0.
  14822. Handle VA_ARG_EXPR, BIT_FIELD_REF and NON_LVALUE_EXPR nodes.
  14823. Treat TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR nodes as
  14824. regular binary expressions.
  14825. Call debug_tree() to dump an unhandled expression.
  14826. (simplify_array_ref): Do not simplify the base of an array.
  14827. (simplify_call_expr): Do not simplify calls to builtins.
  14828. (simplify_cond_expr): Handle conditional expressions of type void.
  14829. (simplify_boolean_expr): Return 'T != 0' instead of 'T'.
  14830. (simplify_save_expr): Do not wrap statement trees inside SAVE_EXPR
  14831. nodes.
  14832. (tree_last_decl): Ignore FILE_STMT nodes preceding a SCOPE_STMT.
  14833. * tree-simple.c: Update grammar to accept any valid C array as the
  14834. array base.
  14835. (is_simple_compstmt): Accept DECL_INITIAL expressions for read-only
  14836. variables.
  14837. (is_simple_expr): Do not abort if the incoming tree is NULL.
  14838. (is_simple_modify_expr): Allow SAVE_EXPR, EXPR_WITH_FILE_LOCATION
  14839. and NON_LVALUE_EXPR wrappers.
  14840. (is_simple_binary_expr): Ditto.
  14841. (is_simple_condexpr): Ditto.
  14842. Accept TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR.
  14843. (is_simple_unary_expr): Do not abort it the incoming tree is NULL.
  14844. Allow SAVE_EXPR, EXPR_WITH_FILE_LOCATION and NON_LVALUE_EXPR
  14845. wrappers.
  14846. Handle BIT_FIELD_REF and VA_ARG_EXPR nodes.
  14847. (is_simple_call_expr): Always return 1 for builtin calls.
  14848. (is_simple_arrayref): Do not check the array base.
  14849. 2002-04-30 Daniel Berlin <dberlin@dberlin.org>
  14850. * c-simplify.c (simplify_call_expr): Don't try to simplify
  14851. call_expr arglist if it's not there.
  14852. 2002-04-27 Diego Novillo <dnovillo@redhat.com>
  14853. * c-decl.c (c_expand_body): Call simplify_tree to simplify a
  14854. FUNCTION_DECL node.
  14855. * c-simplify.c (simplify_tree): New function.
  14856. (simplify_stmt): Remove variable 'new_vars'. Update all called
  14857. functions.
  14858. Remove argument 'scope'. Update all callers.
  14859. Do not keep track of new scope statements as they are entered.
  14860. Do not call declare_tmp_vars().
  14861. (simplify_for_stmt): Remove argument new_vars_p. Update all callers.
  14862. (simplify_while_stmt): Ditto.
  14863. (simplify_do_stmt): Ditto.
  14864. (simplify_if_stmt): Ditto.
  14865. (simplify_switch_stmt): Ditto.
  14866. (simplify_decl_stmt): Reformat comments.
  14867. (simplify_expr): Remove argument new_vars_p. Update all callers.
  14868. Call simplify_save_expr() to simplify SAVE_EXPR nodes.
  14869. Call simplify_expr_wfl() to simplify EXPR_WITH_FILE_LOCATION nodes.
  14870. Do not call is_unop() and is_binop() when checking for unary and
  14871. binary operators.
  14872. Do not return early after simplify statement-expressions.
  14873. Do not call add_modify_stmt() to create assignment expressions.
  14874. (simplify_array_ref): Remove argument new_vars_p. Update all callers.
  14875. (simplify_self_mod_expr): Ditto.
  14876. (simplify_component_ref): Ditto.
  14877. (simplify_call_expr): Ditto.
  14878. (simplify_tree_list): Ditto.
  14879. (simplify_cond_expr): Ditto.
  14880. (simplify_modify_expr): Ditto.
  14881. (simplify_boolean_expr): Ditto.
  14882. (simplify_compound_expr): Ditto.
  14883. (simplify_save_expr): New function.
  14884. (simplify_expr_wfl): New function.
  14885. (tree_build_scope): Reformat.
  14886. (add_tree): Call stmt_has_effect() and expr_has_effect() to decide
  14887. whether or not to add a new tree to the list.
  14888. (add_modify_stmt): Remove.
  14889. (create_tmp_var): Remove 'new_vars_p' argument.
  14890. Call pushdecl() to insert the newly created variable in the current
  14891. binding scope.
  14892. (declare_tmp_vars): Do not create a BLOCK_VARS for the scope.
  14893. (is_binop): Remove.
  14894. (is_unop): Remove.
  14895. (expr_has_effect): New function.
  14896. * c-tree.h (simplify_tree): Remove second argument.
  14897. * stmt.c (warn_if_unused_value): Check operand 0 of SAVE_EXPR
  14898. nodes.
  14899. * tree-dfa.c (find_refs_in_expr): Call find_refs_in_expr() to look
  14900. inside an EXPR_WITH_FILE_LOCATION node.
  14901. * tree-simple.c (is_simple_stmt): Add a case for SCOPE_STMT nodes.
  14902. (is_simple_compstmt): Assume that T is the first tree in the
  14903. compound statement's body.
  14904. Stop when a scope ending SCOPE_STMT node is found.
  14905. (is_simple_binary_expr): Don't call is_simple_binop().
  14906. (is_simple_condexpr): Don't call is_simple_relop().
  14907. (is_simple_binop): Remove.
  14908. (is_simple_relop): Remove.
  14909. (is_simple_unary_expr): Accept any operator with tree code class
  14910. '1' followed by a simple value.
  14911. Accept simple unary expressions wrapped inside SAVE_EXPR,
  14912. EXPR_WITH_FILE_LOCATION and NON_LVALUE_EXPR nodes.
  14913. (is_simple_id): Accept simple identifiers wrapped inside SAVE_EXPR,
  14914. EXPR_WITH_FILE_LOCATION and NON_LVALUE_EXPR nodes.
  14915. * tree-simple.h (create_tmp_var): Remove second argument.
  14916. (is_simple_binop): Remove.
  14917. (is_simple_relop): Remove.
  14918. 2002-04-22 Diego Novillo <dnovillo@redhat.com>
  14919. * c-simplify.c (stmt_has_effect): New function.
  14920. (simplify_stmt): Fix example code in comment.
  14921. Use EXPR_STMT_EXPR to access the expression in an expression
  14922. statement.
  14923. Call debug_c_node to display unhandled statements.
  14924. Call stmt_has_effect to determine whether the statement has been
  14925. nullified by the simplification process.
  14926. (simplify_for_stmt): Do not simplify the initialization expression
  14927. if it's NULL.
  14928. Do not convert post_cond_s into a statement chain.
  14929. Do not simplify the expression if it's NULL.
  14930. (simplify_switch_stmt): initialize post_cond_s to NULL before
  14931. simplifying the expression.
  14932. (simplify_expr): Rename argument IS_LHS to NEEDS_LVALUE. Update
  14933. all uses.
  14934. When simplifying assignments, return the LHS of the assignment if
  14935. the caller wants to use the assignment as an rvalue.
  14936. Do not simplify ADDR_EXPR nodes.
  14937. Handle NOP_EXPR, CONVERT_EXPR, FIX_TRUNC_EXPR, FIX_CEIL_EXPR,
  14938. FIX_ROUND_EXPR, INDIRECT_REF, NEGATE_EXPR, INTEGER_CST, STRING_CST,
  14939. COMPLEX_CST.
  14940. Abort if the expression has not been simplified and cannot be used
  14941. as an rvalue to assign it to a temporary.
  14942. When creating a new temporary to hold an lvalue, if the expression
  14943. is an indirect reference, use the address of the referenced object.
  14944. When creating an indirect reference, use the pointed-to type as the
  14945. type of the reference.
  14946. (simplify_self_mod_expr): If the LHS operand needs to be
  14947. simplified, simplify twice. Once to produce an lvalue and another
  14948. to produce a simple value.
  14949. (simplify_modify_expr): Break assignment chains (a = b = c = ...)
  14950. into individual assignments.
  14951. (simplify_compound_expr):
  14952. (create_tmp_var): If the type is an array, use TYPE_POINTER_TO as
  14953. the pointer type.
  14954. (update_line_number): Fix typo in comment.
  14955. (is_unop): Ditto.
  14956. (convert_to_stmt_chain): Only add statements that comply with
  14957. stmt_has_effect().
  14958. * tree-dfa.c (find_declaration): Fix typo in comment.
  14959. (debug_varref): Ditto.
  14960. * tree-flow.h: Ditto.
  14961. * tree-simple.c (is_simple_stmt): New function.
  14962. (is_simple_compstmt): New function.
  14963. (is_simple_expr): Fix typo in comment.
  14964. (is_simple_rhs): Allow conditional expressions.
  14965. (is_simple_modify_expr): Fix typo in comment.
  14966. (is_simple_modify_expr_lhs): Ditto.
  14967. (is_simple_binary_expr): Ditto.
  14968. (is_simple_condexpr): Ditto.
  14969. (is_simple_relop): Ditto.
  14970. (is_simple_unary_expr): Ditto.
  14971. Allow taking the address of a constant (for strings).
  14972. (is_simple_call_expr): Fix typo in comment.
  14973. Call is_simple_id to determine if the first operand is a SIMPLE
  14974. function identifier.
  14975. (is_simple_arglist): Fix typo in comment.
  14976. (is_simple_varname): Ditto.
  14977. (is_simple_const): Don't accept casts of SIMPLE constants.
  14978. (is_simple_id): Don't accept casts of SIMPLE identifiers.
  14979. (is_simple_val): Fix typo in comment.
  14980. (is_simple_arrayref): Ditto.
  14981. (is_simple_compref): Ditto.
  14982. (is_simple_compref_lhs): Ditto.
  14983. (is_simple_cast_op): Ditto.
  14984. (is_simple_exprseq): Allow NULL expression sequences.
  14985. * tree-simple.h (is_simple_stmt): Declare
  14986. (is_simple_compstmt): Declare.
  14987. * tree-ssa.c (follow_chain): Fix typo in comment.
  14988. 2002-04-22 Diego Novillo <dnovillo@redhat.com>
  14989. * c-pretty-print.c (dump_c_node): Don't print function
  14990. bodies of FUNCTION_DECL nodes.
  14991. 2002-04-19 Andreas Jaeger <aj@suse.de>
  14992. * Makefile.in (c-call-graph.o): New.
  14993. 2002-04-18 Sebastian Pop <s.pop@laposte.net>
  14994. * c-pretty-print.c (PRINT_FUNCTION_NAME): Define.
  14995. (dump_c_node): Call pretty_print_string to print string.
  14996. Call print_call_name to print function names.
  14997. (pretty_print_string): New function.
  14998. (print_call_name): New function.
  14999. 2002-04-17 Diego Novillo <dnovillo@redhat.com>
  15000. * c-simplify.c (simplify_do_stmt): Call is_simple_condexpr to test
  15001. if the conditional is in SIMPLE form.
  15002. (simplify_if_stmt): Ditto.
  15003. 2002-04-17 Diego Novillo <dnovillo@redhat.com>
  15004. * c-pretty-print.c (dump_c_node): Handle escape sequences in strings.
  15005. (op_symbol): Handle TRUTH_NOT_EXPR.
  15006. * c-simplify.c: Rename 'after' with 'post' and 'before' with 'pre'
  15007. everywhere.
  15008. Re-group some functions and add comments.
  15009. (simplify_stmt): Update calls to simplify_for_stmt,
  15010. simplify_while_stmt, simplify_do_stmt and simplify_switch_stmt.
  15011. Call simplify_if_stmt.
  15012. Do not test if expression is in SIMPLE form before calling
  15013. simplify_expr.
  15014. Call convert_to_stmt_chain to emit statement trees for side effects
  15015. found while simplifying.
  15016. (simplify_for_stmt): Re-implement. Do not change structure of the
  15017. statement. Simplify each header expression and emit side effects
  15018. at sequence points.
  15019. (simplify_while_stmt): Ditto.
  15020. (simplify_do_stmt): Ditto.
  15021. (simplify_switch_stmt): Ditto.
  15022. (new_simplified_if): Rename to simplify_if_stmt.
  15023. Call simplify_expr to simplify the conditional.
  15024. (simplify_if_stmt): New name for new_simplified_if.
  15025. (simplify_expr): Do not default simple_test_f to is_simple_expr.
  15026. If simple_test_f is not set, abort.
  15027. Handle COMPOUND_EXPR, MODIFY_EXPR, TRUTH_ANDIF_EXPR,
  15028. TRUTH_ORIF_EXPR, SAVE_EXPR and EXPR_WITH_FILE_LOCATION.
  15029. (simplify_arglist): Rename to simplify_tree_list.
  15030. (simplify_tree_list): New name for simplify_arglist.
  15031. (simplify_boolean_expr): New function.
  15032. (simplify_compound_expr): New function.
  15033. (tree_build_scope): Use SCOPE_BEGIN_P instead of TREE_LANG_FLAG_0
  15034. to access scope operands. Use COMPOUND_BODY instead of
  15035. TREE_OPERAND to access the body of the compound statement.
  15036. (add_tree): Use a TREE_LIST container instead of directly chaining the
  15037. trees.
  15038. (add_assignment_tree): Rename to add_modify_stmt. Update all
  15039. callers.
  15040. (add_modify_stmt): New name for add_assignment_tree.
  15041. (insert_before_continue_end): Do nothing it the tree to insert is
  15042. NULL.
  15043. (copy_stmt_chain): Rename to deep_copy_list. Update all callers.
  15044. (deep_copy_list): New name for copy_stmt_chain.
  15045. (copy_stmt): Rename to deep_copy_node. Update all callers.
  15046. (deep_copy_node): New name for copy_stmt. Handle TREE_LIST
  15047. trees.
  15048. (insert_before_first): New function.
  15049. (is_binop): Add COMPOUND_EXPR.
  15050. (convert_to_stmt_chain): New function.
  15051. * tree-cfg.c (make_for_stmt_blocks): Fix comment.
  15052. * tree-simple.c (is_simple_condexpr): New function.
  15053. (is_simple_const): Allow casts of SIMPLE constants.
  15054. (is_simple_id): Allow casts of SIMPLE identifiers.
  15055. (is_simple_cast): Call is_simple_cast_op.
  15056. (is_simple_cast_op): New function.
  15057. (is_simple_exprseq): New function.
  15058. * tree-simple.h (deep_copy_list): Declare.
  15059. (deep_copy_node): Declare.
  15060. (is_simple_cast_op): Declare.
  15061. (is_simple_exprseq): Declare.
  15062. 2002-04-03 Diego Novillo <dnovillo@redhat.com>
  15063. * c-simplify.c (simplify_expr): Add arguments simple_tree_f and
  15064. is_lhs. Update all callers.
  15065. Call simplify_call_expr, simplify_cond_expr, simplify_arglist and
  15066. simplify_modify_expr.
  15067. Call is_unop and is_binop to check for unary and binary operators.
  15068. (simplify_binary_expr): Remove.
  15069. (simplify_call_expr): New function.
  15070. (simplify_arglist): New function.
  15071. (simplify_cond_expr): New function.
  15072. (simplify_modify_expr): New function.
  15073. (keep_stmt_p): Remove.
  15074. (is_binop): New function.
  15075. (is_unop): New function.
  15076. (simplify_stmt): Don't call keep_stmt_p.
  15077. (simplify_decl_stmt): Call add_assignment_tree.
  15078. * tree-simple.c: Include c-tree.h
  15079. Add expression-statements to the SIMPLE grammar.
  15080. (is_simple_modify_expr_lhs): New function.
  15081. (is_simple_modify_expr): Call it.
  15082. (is_simple_relop): Update comment.
  15083. (is_simple_unary_expr): Allow expression-statements.
  15084. (is_simple_arglist): New function.
  15085. (is_simple_call_expr): Call it.
  15086. (is_simple_id): Accept expressions taking the address of a
  15087. function.
  15088. * tree-simple.h (is_simple_modify_expr_lhs): Declare.
  15089. (is_simple_arglist): Declare.
  15090. 2002-03-21 Diego Novillo <dnovillo@redhat.com>
  15091. * Makefile.in (c-simplify.o): Add dependency on varray.h.
  15092. * c-simplify.c: Include varray.h.
  15093. Remove comments with SIMPLE grammar.
  15094. (simplify_array_ref): New.
  15095. (simplify_self_mod_expr): New.
  15096. (simplify_component_ref): New.
  15097. (add_assignment_tree): New.
  15098. (simplify_expr): Call simplify_array_ref to simplify array
  15099. references.
  15100. Call simplify_self_mod_expr to simplify ++, --, += and -=
  15101. expressions.
  15102. Call simplify_component_ref to simplify references to structures.
  15103. (simplify_binary_expr): Do not check whether the expression is
  15104. already in SIMPLE form.
  15105. * tree-simple.c: Document changes from original SIMPLE grammar.
  15106. (is_simple_unary_expr): Add check for *ID.
  15107. (is_simple_call_expr): Update comments.
  15108. (is_simple_const): Ditto.
  15109. (is_simple_id): Do not accept *ID expressions.
  15110. (is_simple_val): Update comments.
  15111. (is_simple_arrayref): Accept any variable name as the base address.
  15112. (is_simple_compref_lhs): New.
  15113. (is_simple_compref): Call it.
  15114. * tree-simple.h (is_simple_compref_lhs): Declare.
  15115. 2002-03-18 Diego Novillo <dnovillo@redhat.com>
  15116. * Makefile.in (C_AND_OBJC_OBJS): Add tree-simple.o
  15117. (tree-simple.o): New rule.
  15118. * c-simplify.c (simplified_p): Remove.
  15119. (simplified_rec_p): Remove.
  15120. (simplified_condition_p): Remove.
  15121. (simplify_for_stmt): Call is_simple_expr instead of
  15122. simplified_condition_p.
  15123. (simplify_while_stmt): Ditto.
  15124. (simplify_do_stmt): Call is_simple_expr instead of simplified_p.
  15125. (new_simplified_if): Call is_simple_expr instead of
  15126. simplified_rec_p.
  15127. (simplify_decl_stmt): Update comment.
  15128. (simplify_expr): Return the original expression if it's already
  15129. in SIMPLE form.
  15130. Do not special case most binary and unary expressions.
  15131. When simplifying array references, create temporary variables to
  15132. hold the base address for the array.
  15133. Simplify COMPONENT_REF expressions separately.
  15134. Call simplify_binary_expr to handle most binary expressions.
  15135. (simplify_binary_expr): New function.
  15136. (keep_stmt_p): Call is_simple_unary_expr to determine whether the
  15137. statement should be kept or not.
  15138. * tree-simple.c: New file.
  15139. * tree-simple.h (is_simple_expr): Declare.
  15140. (is_simple_rhs): Declare.
  15141. (is_simple_modify_expr): Declare.
  15142. (is_simple_binary_expr): Declare.
  15143. (is_simple_binop): Declare.
  15144. (is_simple_relop): Declare.
  15145. (is_simple_unary_expr): Declare.
  15146. (is_simple_call_expr): Declare.
  15147. (is_simple_const): Declare.
  15148. (is_simple_id): Declare.
  15149. (is_simple_varname): Declare.
  15150. (is_simple_val): Declare.
  15151. (is_simple_arrayref): Declare.
  15152. (is_simple_compref): Declare.
  15153. (is_simple_cast): Declare.
  15154. * cp/Make-lang.in (CXX_C_OBJS): Add tree-simple.o
  15155. 2002-03-18 Diego Novillo <dnovillo@redhat.com>
  15156. * tree-simple.h: New file.
  15157. * Makefile.in (c-simplify.o): Add dependency on tree-simple.h
  15158. * c-simplify.c: Reformat some comments.
  15159. (tree_last_decl): Declare.
  15160. 2002-03-18 Sebastian Pop <s.pop@laposte.net>
  15161. * c-simplify.c (insert_stmt_chain): Delete.
  15162. (simplified_condition_p, insert_after_case_labels): New.
  15163. (simplify_stmt, simplify_for_stmt, simplify_while_stmt,
  15164. simplify_do_stmt, new_simplified_if, simplify_switch_stmt):
  15165. Returns a single node, generate a chain of statements to be executed
  15166. before the if, and a list of new variables.
  15167. (new_simplified_if): Simplify clauses.
  15168. (simplify_expr): Remove unused parameter scope.
  15169. 2002-03-14 Sebastian Pop <s.pop@laposte.net>
  15170. * c-simplify.c (simplify_switch_stmt, simplify_expr): Add scope
  15171. parameter.
  15172. (simplify_while_stmt, simplify_do_stmt, simplify_for_stmt): Avoid
  15173. negating loop condition during simplification.
  15174. (new_simplified_if): Don't simplify the IF_BODY.
  15175. (copy_stmt_chain): Use copy_stmt.
  15176. (copy_stmt): New function.
  15177. 2002-02-28 Sebastian Pop <s.pop@laposte.net>
  15178. * tree-dfa.c (find_refs_in_stmt): Changed if/else statements in
  15179. a switch.
  15180. 2002-02-28 Sebastian Pop <s.pop@laposte.net>
  15181. * c-simplify.c (simplify_if_stmt): Deleted.
  15182. (new_simplified_if): New function.
  15183. (make_type_writable): New function.
  15184. (insert_before_continue_end): New function.
  15185. (insert_before_continue): New function.
  15186. (copy_stmt_chain): New function.
  15187. (insert_stmt_chain): New function.
  15188. (update_line_number): New function.
  15189. (simplified_p): New function.
  15190. (simplified_rec_p) New function.
  15191. (simplify_stmt): Modify the way to call simplification
  15192. of COMPOUND_STMT, FOR_STMT, WHILE_STMT, DO_STMT, IF_STMT,
  15193. and SCOPE_STMT in order to avoid to execute the code after
  15194. the switch. Add FILE_STMT, LABEL_STMT, GOTO_STMT, ASM_STMT cases.
  15195. Simplified a little the code after the switch.
  15196. (simplify_for_stmt): Change functions parameters.
  15197. Add code to simplify the FOR_INIT_STMT, FOR_COND, FOR_EXPR.
  15198. (simplify_while_stmt): Change functions parameters.
  15199. Add code to simplify the WHILE_COND.
  15200. (simplify_do_stmt): Change functions parameters.
  15201. Add code to simplify the DO_COND.
  15202. (simplify_switch_stmt): Change functions parameters.
  15203. (simplify_expr): Remove scope parameter.
  15204. Avoid to introduce a new temporary variable for an expression
  15205. that is already simplified.
  15206. ([ARRAY|COMPONENT]_REF, COND_EXPR): Handle them apart.
  15207. (TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR): Avoid to evaluate the second
  15208. operand if the value can be deduced from the first one.
  15209. (keep_stmt_p): Add some other cases in which we don't need to keep
  15210. a statement after its simplification.
  15211. 2002-02-28 Sebastian Pop <s.pop@laposte.net>
  15212. * Makefile.in: Add c-call-graph.o dependence.
  15213. * c-call-graph.c: New file.
  15214. * c-decl.c (c_expand_body): Add an entry point for call-graph.
  15215. * tree-dump.c (dump_files): Add the flag dump-call-graph.
  15216. * tree.h (tree_dump_index): Add TDI_xml.
  15217. 2002-02-28 Sebastian Pop <s.pop@laposte.net>
  15218. * c-pretty-print.c (dump_c_tree): Declare it extern.
  15219. (dump_c_node): Declare it extern.
  15220. (dump_c_scope_vars): Deleted, some code moved in print_declaration ().
  15221. (print_declaration): New function.
  15222. (print_function_decl): New function.
  15223. (print_struct_decl): New function.
  15224. (INDENT_PRINT_C_NODE): Deleted.
  15225. (INDENT): New macro.
  15226. (NIY): Define the macro body in a block.
  15227. (dump_c_node): Add dumping for TREE_PURPOSE operand in TREE_LIST.
  15228. [VOID|INTEGER|REAL|COMPLEX|VECTOR|ENUMERAL|BOOLEAN|CHAR]_TYPE nodes:
  15229. insert some code from print-tree.c:print_node_brief () in order to
  15230. stabilise the type printing.
  15231. [RECORD|UNION]_TYPE nodes: Don't print their contents by default,
  15232. move the existing code in print_struct_decl ().
  15233. [POSTDECREMENT|POSTINCREMENT]_EXPR: Print the operand in post postion.
  15234. [MIN|MAX|ABS]_EXPR: New code for printing these nodes.
  15235. FOR_STMT: Don't print the FOR_BODY if it is not present.
  15236. RETURN_STMT: Don't print the return expression for a void function.
  15237. ASM_STMT: New code for printing this node.
  15238. SCOPE_STMT: Use print_declaration instead of dump_c_scope_vars.
  15239. COMPOUND_LITERAL_EXPR: Add the node as not implemented yet.
  15240. (op_prio): Fix switch indent.
  15241. Add node EXPR_WITH_FILE_LOCATION with priority 16.
  15242. (op_symbol): Fix switch indent.
  15243. 2002-01-25 Diego Novillo <dnovillo@redhat.com>
  15244. * Makefile.in (c-pretty-print.o): Add dependency on errors.h.
  15245. * c-decl.c (c_expand_body): React to -ftree-dump-simple.
  15246. * c-pretty-print.c: Fix typo in header comment.
  15247. (NYI): Flush output buffer, dump the tree and abort.
  15248. (dump_c_node): Add unparsing code for ERROR_MARK, IDENTIFIER_NODE,
  15249. ARRAY_TYPE, UNION_TYPE, STRING_CST, CEIL_DIV_EXPR, FLOOR_DIV_EXPR,
  15250. ROUND_DIV_EXPR, TRUNC_MOD_EXPR, FLOOR_MOD_EXPR, ROUND_MOD_EXPR,
  15251. RDIV_EXPR, EXACT_DIV_EXPR, LROTATE_EXPR, RROTATE_EXPR,
  15252. BIT_ANDTC_EXPR, BIT_NOT_EXPR, UNORDERED_EXPR, SAVE_EXPR and
  15253. EXPR_WITH_FILE_LOCATION.
  15254. Unify unparsing code for common binary and unary expressions.
  15255. Handle indirect references like any other unary expression.
  15256. (dump_c_scope_vars): Remove unused variable 'context'.
  15257. Call dump_c_node to print the type.
  15258. (dump_c_indirect_ref): Remove.
  15259. (op_prio): New function.
  15260. (op_symbol): New function.
  15261. * c-simplify.c (simplify_stmt): Do not simplify a return
  15262. expression, only its second operand.
  15263. Fix capitalization in error message.
  15264. (simplify_expr): Add documentation.
  15265. Fix capitalization in error message.
  15266. * tree-dump.c (dump_files): Add entry for -fdump-tree-simple.
  15267. (dump_options): Add entry for -unparse.
  15268. * tree.h (TDI_simple): Define.
  15269. (TDF_UNPARSE): Define.
  15270. * doc/invoke.texi: Document -fdump-tree-simple.
  15271. 2002-01-23 Sebastian Pop <s.pop@laposte.net>
  15272. * c-pretty-print.c: Clean C++ comments.
  15273. (debug_output_buffer): Remove declaration and definition.
  15274. * diagnostic.h (debug_output_buffer): Add declaration.
  15275. * diagnostic.c (debug_output_buffer): Add definition.
  15276. 2002-01-21 Diego Novillo <dnovillo@redhat.com>
  15277. * tree-dfa.c (find_refs_in_stmt): Fix capitalization in error
  15278. message.
  15279. (find_refs_in_expr): Ditto.
  15280. 2002-01-20 Diego Novillo <dnovillo@redhat.com>
  15281. Sebastian Pop <s.pop@laposte.net>
  15282. * Makefile.in: Add c-simplify.o.
  15283. * cp/Make-lang.in: Ditto.
  15284. * c-decl.c (c_expand_body): Call simplify_stmt() before
  15285. calling optimize_tree().
  15286. * c-simplify.c: New file.
  15287. * c-tree.h (simplify_stmt): Declare.
  15288. (print_c_tree)
  15289. * tree-dfa.c (find_refs_in_stmt): Fix error message for unhandled
  15290. statement codes.
  15291. 2002-01-20 Sebastian Pop <s.pop@laposte.net>
  15292. * Makefile.in: Add c-pretty-print.o.
  15293. * cp/Make-lang.in: Ditto.
  15294. * c-pretty-print.c: New file.
  15295. * c-tree.h (print_c_tree): Declare.
  15296. (print_c_node): Declare.
  15297. (debug_c_tree): Declare.
  15298. (debug_c_node): Declare.
  15299. 2001-12-29 Diego Novillo <dnovillo@redhat.com>
  15300. * c-lang.c (c_post_options): Move code to enable tree-ssa
  15301. if -Wuninitialized is used ...
  15302. * c-common.c (c_common_post_options): ... here.
  15303. 2001-12-29 Diego Novillo <dnovillo@redhat.com>
  15304. * Makefile.in (tree-optimize.o): Don't depend on c-common.h
  15305. * tree-cfg.c: Don't include c-tree.h. Explain why we need to
  15306. include c-common.h.
  15307. * tree-dfa.c: Explain why we need to include c-common.h.
  15308. * tree-ssa.c: Ditto.
  15309. * tree-optimize.c: Don't include c-common.h
  15310. 2001-12-21 Nathan Sidwell <nathan@codesourcery.com>
  15311. Revert my patch of 2001-07-23 for the moment.
  15312. 2001-10-15 Diego Novillo <dnovillo@redhat.com>
  15313. * tree-dfa.c (create_varref): If the new reference is inside a
  15314. statement, add it to the list of references for that statement.
  15315. 2001-10-14 Diego Novillo <dnovillo@redhat.com>
  15316. * Merge from mainline:
  15317. Tue Sep 11 11:37:52 CEST 2001 Jan Hubicka <jh@suse.cz>
  15318. * basic-block.h (cached_make_edge): New.
  15319. (make_edge): Remove first parameter.
  15320. * flow.c (cached_make_edge): Rename from make_edge; return
  15321. newly created edge; use obstack allocation.
  15322. (make_edge): New.
  15323. (flow_call_edges_add): Updaet make_edge call.
  15324. (add_noreturn_fake_exit_edges): Likewise.
  15325. (connect_infinite_loops_to_exit): Liekwise.
  15326. (make_label_edge, make_edges, find_sub_basic_blocks): Use
  15327. cached_make_edge.
  15328. * profile.c (branch_prob): Update make_edge call.
  15329. * ssa-dce.c (ssa_eliminate_dead_code): Likewise.
  15330. 2001-10-14 Diego Novillo <dnovillo@redhat.com>
  15331. * Makefile.in (tree-ssa.o): Remove dependency on flags.h.
  15332. (tree-optimize.o): Add dependency on flags.h.
  15333. * bb-reorder.c (fixup_reorder_chain): Update call to make_edge.
  15334. * c-lang.c (c_post_options): Set flag_tree_ssa if -Wuninitialized
  15335. is given.
  15336. * ifcvt.c (find_if_case_1): Update call to make_edge.
  15337. * toplev.c (toplev_main): Do not warn about -Wuninitialized without
  15338. -O if -ftree-ssa is used.
  15339. * tree-cfg.c (dot_dump_file): Remove.
  15340. (dot_dump_flags): Remove.
  15341. (cfg_dump_file): Rename to dump_file.
  15342. (cfg_dump_flags): Rename to dump_flags.
  15343. (remove_bb_ann): New function.
  15344. (tree_find_basic_blocks): Do not open dump files at the beginning
  15345. of the function.
  15346. Do not call delete_cfg.
  15347. Create annotations for ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR.
  15348. (make_for_stmt_blocks): Update FOR_INIT_STMT_BB and FOR_COND_BB
  15349. when creating the header blocks.
  15350. Create the blocks for the loop body before the expression block.
  15351. (make_while_stmt_blocks): Update END_WHILE_BB when creating the
  15352. header blocks.
  15353. Create the blocks for the loop body before the end-while block.
  15354. (make_do_stmt_blocks): Update DO_COND_BB when creating header
  15355. blocks.
  15356. Create the blocks for the loop body before the block for DO_COND.
  15357. (create_bb): When creating loop header blocks, allocate space for
  15358. the header_blocks union.
  15359. Call create_bb_ann to create a new annotation.
  15360. (remove_bb_ann): New function.
  15361. (tree_split_bb): New function.
  15362. (make_edges): Remove first argument from call to make_edge,
  15363. make_ctrl_stmt_edges, make_exit_edges, make_for_stmt_edges,
  15364. make_while_stmt_edges, make_do_stmt_edges, make_if_stmt_edges,
  15365. make_goto_stmt_edges, make_break_stmt_edges and
  15366. make_continue_stmt_edges.
  15367. When creating edges for the default label, remove the fallthru edge
  15368. that was created for the associated SWITCH_STMT entry block.
  15369. Do not call delete_unreachable_blocks.
  15370. Call tree_cleanup_cfg.
  15371. (make_ctrl_stmt_edges): Remove first argument.
  15372. (make_exit_edges): Remove first argument.
  15373. If the last element of the block is an EXPR_STMT, assume that it is
  15374. the call to a non-returning function and make an edge to the exit
  15375. block.
  15376. Do not call make_return_stmt_edges. Call make_edge directly.
  15377. (make_for_stmt_edges): Remove first argument.
  15378. Simplify the graph for infinite and zero-iteration loops.
  15379. (make_while_stmt_edges): Remove first argument.
  15380. Simplify the graph for infinite and zero-iteration loops.
  15381. (make_do_stmt_edges): Remove first argument.
  15382. Simplify the graph for infinite and one-iteration loops.
  15383. (make_if_stmt_edges): Remove first argument.
  15384. Simplify the graph for always-true and always-false conditionals.
  15385. (make_goto_stmt_edges): Remove first argument.
  15386. (make_break_stmt_edges): Remove first argument.
  15387. (make_continue_stmt_edges): Remove first argument.
  15388. (make_return_stmt_edges): Remove.
  15389. (tree_cleanup_cfg): New function.
  15390. (delete_unreachable_blocks): Do not react to -Wunreachable-code.
  15391. Write to dump file blocks that have been removed.
  15392. Call remove_edge.
  15393. (is_ctrl_altering_stmt): If the statement contains a call to a
  15394. non-returning function, return 1.
  15395. (delete_cfg): Call remove_bb_ann. Also remove annotations for
  15396. ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR.
  15397. (latch_block): Use WHILE_COND_BB instead of END_WHILE_BB.
  15398. (insert_stmt_tree_before): Use cfg_dump_file instead of dump_file.
  15399. (insert_before_ctrl_stmt): Ditto.
  15400. (insert_before_normal_stmt): Ditto.
  15401. (insert_stmt_tree_after): Ditto.
  15402. (insert_after_ctrl_stmt): Ditto.
  15403. (insert_after_normal_stmt): Ditto.
  15404. (replace_expr_in_tree): Ditto.
  15405. (insert_bb_before): Ditto.
  15406. * tree-dfa.c (tree_find_varrefs): Call find_refs_in_expr when the
  15407. tree is not a statement.
  15408. (find_refs_in_stmt): Update comments.
  15409. Do not deal with FOR_STMT and DO_STMT trees separately.
  15410. When processing VAR_DECLs, call find_refs_in_expr with the
  15411. declaration, not its initial value.
  15412. (find_refs_in_expr): When processing COMPONENT_REFs and ARRAY_REFs,
  15413. recurse using the same reference type that was given by the
  15414. original caller.
  15415. (create_varref): Insert new PHI terms at the beginning of the
  15416. BB_REFS array, not the end.
  15417. * tree-flow.h (struct for_header_blocks): Declare.
  15418. (union header_blocks): Declare.
  15419. (struct bb_ann_def): Add new field 'loop_hdr'.
  15420. (BB_ANN): Re-define so that it can be used as an lvalue.
  15421. (BB_PARENT): Ditto.
  15422. (BB_REFS): Ditto.
  15423. (BB_PREV_CHAIN): Ditto.
  15424. (BB_BINDING_SCOPE): Ditto.
  15425. (BB_LOOP_HDR): Define.
  15426. (FOR_INIT_STMT_BB): Redefine using BB_LOOP_HDR.
  15427. (FOR_COND_BB): Ditto.
  15428. (FOR_EXPR_BB): Ditto.
  15429. (DO_COND_BB): Ditto.
  15430. (END_WHILE_BB): New name for WHILE_COND_BB.
  15431. (tree_warn_uninitialized): Declare.
  15432. (tree_cleanup_cfg): Declare.
  15433. (tree_split_bb): Declare.
  15434. * tree-optimize.c: Include flags.h.
  15435. (init_tree_flow): New function.
  15436. (optimize_tree): Call build_tree_ssa instead of building SSA
  15437. in-place.
  15438. (build_tree_ssa): New function.
  15439. * tree-optimize.h (build_tree_ssa): Declare.
  15440. * tree-ssa.c: Don't include toplev.h
  15441. (tree_warn_uninitialized): Define.
  15442. (tree_compute_rdefs): Do not call is_upward_exposed. Instead
  15443. traverse all the uses of each variable and warn if the use is
  15444. reached by the ghost definition.
  15445. 2001-10-10 Graham Stott <grahams@redhat.com>
  15446. * tree-cfg.c (create_bb): Add new binding_scope parameter which allows
  15447. the binding scope either to be explicitly specified if non-zero.
  15448. (make_blocks): Update call to create_bb.
  15449. (make_for_stmt_blocks): Ditto.
  15450. (make_while_stmt_blocks): Ditto.
  15451. (make_do_stmt_blocks): Ditto.
  15452. (make_if_stmt_blocks): Ditto.
  15453. (make_switch_stmt_blocks): Ditto.
  15454. (create_maximal_bb): Ditto.
  15455. (make_edges): If a statement expression is in the last basic
  15456. block create an edge to EXIT_BLOCK_PTR and not the next block.
  15457. (insert_before_normal_stmt): Pass the appropriate binding scope to
  15458. create_bb.
  15459. 2001-10-01 Graham Stott <grahams@redhat.com>
  15460. Diego Novillo <dnovillo@redhat.com>
  15461. * tree-optimize.c (optimize_tree): Early return if the program has
  15462. errors.
  15463. 2001-09-30 Diego Novillo <dnovillo@redhat.com>
  15464. * tree-optimize.c (optimize_tree): Compute reaching definitions
  15465. after building SSA.
  15466. 2001-09-30 Diego Novillo <dnovillo@redhat.com>
  15467. * tree-cfg.c (insert_after_ctrl_stmt): Remove unused argument.
  15468. (make_blocks): Pop top element from scope binding stack when an end
  15469. of scope statement is found.
  15470. (create_bb): Remove code for popping top element from scope binding
  15471. stack.
  15472. Do not push basic block 0 to initialize scope binding stack.
  15473. (insert_stmt_tree_after): Remove unused argument from call to
  15474. insert_after_ctrl_stmt.
  15475. (tree_dump_bb): Dump BB_BINDING_SCOPE if defined.
  15476. * doc/invoke.texi: Document debugging option -ftree-dump-ssa-rdefs.
  15477. 2001-09-29 Diego Novillo <dnovillo@redhat.com>
  15478. * Makefile.in (tree-ssa.o): Update dependencies.
  15479. (tree-cfg.o): Ditto.
  15480. (tree-optimize.o): Ditto.
  15481. * basic-block.h (BB_CONTROL_EXPR): Define.
  15482. (BB_CONTROL_ENTRY): Define.
  15483. * c-common.h (TDF_RDEFS): Define.
  15484. * c-dump.c (dump_option_value_in): Add entry for TDF_RDEFS.
  15485. * tree-cfg.c: Include flags.h and c-tree.h
  15486. (binding_stack): New local variable.
  15487. (delete_block): Rename to delete_bb.
  15488. (tree_find_basic_blocks): Initialize varray 'binding_stack'.
  15489. Call make_blocks with an additional argument.
  15490. Adjust size of varray 'basic_block_info' after building CFG.
  15491. (make_blocks): Add new argument prev_chain_p.
  15492. Update all callers and callees.
  15493. Create sub-graphs for statement-expressions.
  15494. Update prev_chain_p when accessing the next tree in the chain.
  15495. (make_for_stmt_blocks): Add new argument prev_chain_p.
  15496. Update all callers and callees.
  15497. Update flags for control header blocks with BB_CONTROL_ENTRY and/or
  15498. BB_CONTROL_EXPR.
  15499. (make_while_stmt_blocks): Ditto.
  15500. (make_do_stmt_blocks): Ditto.
  15501. (make_if_stmt_blocks): Ditto.
  15502. (make_switch_stmt_blocks): Ditto.
  15503. (create_maximal_bb): Add new argument prev_chain_p.
  15504. Update all callers and callees.
  15505. (create_bb): Add new argument prev_chain_p.
  15506. Push basic block 0 the first time into the binding scope stack.
  15507. Associate the new basic block to the binding scope at the top of
  15508. the binding stack.
  15509. Push new binding scopes when a SCOPE_BEGIN statement is found.
  15510. Pop the top binding scope when a SCOPE_END statement is found.
  15511. (make_edges): Handle statement expressions.
  15512. Handle case labels preceded by scope statements in switch
  15513. statements.
  15514. (make_for_stmt_edges): Use FOR_INIT_STMT_BB, FOR_COND_BB and
  15515. FOR_EXPR_BB to access the header basic blocks.
  15516. (delete_unreachable_blocks): Call delete_bb instead of
  15517. delete_block.
  15518. (delete_block): Rename to delete_bb.
  15519. (block_invalidates_loop): Use data references to find calls to
  15520. non-pure functions.
  15521. (is_ctrl_stmt): Reformat.
  15522. (loop_body): New function.
  15523. (set_loop_body): New function.
  15524. (stmt_starts_bb_p): Statement expression trees also start a new
  15525. basic block.
  15526. (delete_cfg): Call VARRAY_FREE to delete all the references in each
  15527. basic block.
  15528. (latch_block): Use FOR_EXPR_BB, WHILE_COND_BB and DO_COND_BB to
  15529. find out the latch block for the loop.
  15530. (last_exec_stmt): New function.
  15531. (is_exec_stmt): Scope statements that begin a scope are also
  15532. considered executables.
  15533. (is_statement_expression): New function.
  15534. (first_non_decl_stmt): New function.
  15535. (first_decl_stmt): New function.
  15536. (first_non_label_in_bb): New function.
  15537. (insert_stmt_tree_before): New function.
  15538. (insert_before_ctrl_stmt): New function.
  15539. (insert_before_normal_stmt): New function.
  15540. (insert_stmt_tree_after): New function.
  15541. (insert_after_ctrl_stmt): New function.
  15542. (insert_after_normal_stmt): New function.
  15543. (insert_after_loop_body): New function.
  15544. (replace_expr_in_tree): New function.
  15545. (find_expr_in_tree): New function.
  15546. (insert_bb_before): New function.
  15547. (tree_dump_bb): Display the contents of BB_PREV_CHAIN_P.
  15548. * tree-dfa.c (tree_find_varrefs): Use accessor macros for array
  15549. 'referenced_symbols'.
  15550. (find_refs_in_stmt): Do not process error_mark_node trees.
  15551. Handle statement-expression nodes as any other statement tree.
  15552. Do not call find_refs_in_stmt_expr.
  15553. (find_refs_in_stmt_expr): Remove.
  15554. (add_ref_to_sym): Remove.
  15555. (add_ref_to_bb): Remove.
  15556. (find_refs_in_expr): Do not process error_mark_node trees.
  15557. ADDR_EXPR trees are not variable references except if used in a
  15558. CALL_EXPR node.
  15559. Handle EXPR_WITH_FILE_LOCATION nodes.
  15560. (create_varref): Remove variable 'is_new'.
  15561. Initialize data-flow arrays VARDEF_IMM_USES, VARDEF_RUSES,
  15562. VARDEF_PHI_CHAIN and VARUSE_RDEFS.
  15563. Do not call add_ref_to_sym and add_ref_to_bb.
  15564. (add_ref_symbol): Use accessor macros for varray
  15565. 'referenced_symbols'.
  15566. (function_may_recurse_p): New function.
  15567. (get_fcalls): New function.
  15568. (find_declaration): New function.
  15569. (dump_varref): Handle NULL values of VARREF_EXPR.
  15570. Use VARDEF_PHI_CHAIN instead of VARPHI_CHAIN.
  15571. (dump_varref_list): Check if the list is NULL before traversing it.
  15572. * tree-flow.h (struct vardef): Add fields 'ruses', 'marked' and
  15573. 'phi_chain'.
  15574. (VARDEF_RUSES): Define.
  15575. (VARDEF_MARKED): Define.
  15576. (VARDEF_PHI_CHAIN): Define.
  15577. (VARPHI_CHAIN): Remove.
  15578. (struct varphi): Remove.
  15579. (struct varuse): Add field 'rdefs'.
  15580. (VARUSE_RDEFS): Define.
  15581. (union varref_def): Remove field 'phi'.
  15582. (IS_GHOST_DEF): Define.
  15583. (IS_ARTIFICIAL_REF): Define.
  15584. (struct bb_ann_def): Add fields 'prev_chain_p' and 'binding_scope'.
  15585. (BB_PREV_CHAIN_P): Define.
  15586. (BB_BINDING_SCOPE): Define.
  15587. (FOR_INIT_STMT_BB): Define.
  15588. (FOR_COND_BB): Define.
  15589. (FOR_EXPR_BB): Define.
  15590. (WHILE_COND_BB): Define.
  15591. (DO_COND_BB): Define.
  15592. (IF_COND_BB): Define.
  15593. (CASE_COND_BB): Define.
  15594. (NREF_SYMBOLS): Define.
  15595. (REF_SYMBOL): Define.
  15596. (ADD_REF_SYMBOL): Define.
  15597. (FCALL_NON_PURE): Define.
  15598. (FCALL_PURE): Define.
  15599. (FCALL_BUILT_IN): Define.
  15600. (loop_body): Declare.
  15601. (set_loop_body): Declare.
  15602. (last_exec_stmt): Declare.
  15603. (is_statement_expression): Declare.
  15604. (first_non_decl_stmt): Declare.
  15605. (first_decl_stmt): Declare.
  15606. (first_non_label_in_bb): Declare.
  15607. (insert_stmt_tree_before): Declare.
  15608. (insert_stmt_tree_after): Declare.
  15609. (replace_expr_in_tree): Declare.
  15610. (find_expr_in_tree): Declare.
  15611. (insert_bb_before): Declare.
  15612. (function_may_recurse_p): Declare.
  15613. (get_fcalls): Declare.
  15614. (find_declaration): Declare.
  15615. (tree_compute_rdefs): Declare.
  15616. (analyze_rdefs): Declare.
  15617. (is_upward_exposed): Declare.
  15618. * tree-optimize.c (optimize_tree): Update name for varray
  15619. referenced_symbols.
  15620. Free varray referenced_symbols and call delete_ssa on exit.
  15621. * tree-ssa.c: Include flags.h, diagnostic.h and toplev.h.
  15622. (tree_build_ssa): Create ghost definitions before building FUD
  15623. chains.
  15624. (insert_phi_terms): Use accessor macros for 'referenced_symbols'.
  15625. Ignore ghost definitions when placing PHI terms.
  15626. (build_fud_chains): Call get_tree_ann to create an annotation for
  15627. the symbol if it doesn't already have one.
  15628. (search_fud_chains): Reformat comments.
  15629. Do not initialize varray VARDEF_IMM_USES.
  15630. If a successor basic block does not have references, continue on to
  15631. the next one, do not stop.
  15632. Do not initialize varray VARDEF_PHI_CHAIN.
  15633. (delete_ssa): New function.
  15634. (delete_refs): New function.
  15635. (tree_compute_rdefs): New function.
  15636. (analyze_rdefs): New function.
  15637. (follow_chain): New function.
  15638. (is_upward_exposed): New function.
  15639. 2001-09-14 Diego Novillo <dnovillo@redhat.com>
  15640. * tree-cfg.c (tree_find_basic_blocks): Remove call to
  15641. mark_critical_edges.
  15642. (create_maximal_bb): Do not create annotations for non-executable
  15643. statements.
  15644. (map_stmt_to_bb): Rename basic_block_ann with bb_ann.
  15645. (delete_cfg): Ditto.
  15646. (is_exec_stmt): Reformat.
  15647. (create_bb_ann): New function.
  15648. * tree-dfa.c (create_node): Remove.
  15649. (ref_symbols_list): Remove.
  15650. (create_tree_ann): Declare.
  15651. (referenced_symbols): Declare.
  15652. (tree_find_varrefs): Replace usage of linked lists with variable
  15653. arrays.
  15654. (create_varref): Remove second argument from call to
  15655. add_ref_symbol.
  15656. Update comments.
  15657. (add_ref_to_sym): Replace usage of linked lists with variable
  15658. arrays.
  15659. Declare static.
  15660. (add_ref_to_bb): Ditto.
  15661. (add_ref_symbol): Ditto.
  15662. (dump_varref_list): Ditto.
  15663. (debug_varref_list): Ditto.
  15664. (create_varref_list): Remove.
  15665. (push_ref): Remove.
  15666. (create_node): Remove.
  15667. (delete_varref_list): Remove.
  15668. (get_tree_ann): Call create_tree_ann if the tree doesn't have an
  15669. annotation already.
  15670. (create_tree_ann): New function.
  15671. * tree-flow.h (varref_list_def): Remove.
  15672. (vardef): Change type of field 'imm_uses' to 'varray_type'.
  15673. (varphi): Change type of field 'phi_chain' to 'varray_type'.
  15674. (varref_node_def): Remove.
  15675. (varref_node): Remove.
  15676. (VARREF_NODE_ELEM): Remove.
  15677. (VARREF_NODE_NEXT): Remove.
  15678. (VARREF_NODE_PREV): Remove.
  15679. (varref_list_def): Remove.
  15680. (varref_list): Remove.
  15681. (VARREF_LIST_FIRST): Remove.
  15682. (VARREF_LIST_LAST): Remove.
  15683. (tree_ann_def): Change type of field 'refs' to 'varray_type'.
  15684. (basic_block_ann_def): Rename to 'bb_ann_def'.
  15685. Change type of field 'refs' to 'varray_type'.
  15686. (basic_block_ann): Rename to 'bb_ann'.
  15687. (ref_symbols_list): Remove.
  15688. (referenced_symbols): Declare.
  15689. (add_ref_to_sym): Remove.
  15690. (add_ref_to_bb): Remove.
  15691. (add_ref_symbol): Remove.
  15692. (remove_ann_from_sym): Remove.
  15693. (create_varref_list): Remove.
  15694. (push_ref): Remove.
  15695. (delete_varref_list): Remove.
  15696. (debug_varref_list): Update argument type to be 'varray_type'.
  15697. (dump_varref_list): Ditto.
  15698. * tree-optimize.c: Include 'basic-block.h'.
  15699. (optimize_tree): Replace references to 'ref_symbols_list' with
  15700. 'referenced_symbols'.
  15701. Remove call to delete_varref_list.
  15702. * tree-ssa.c (insert_phi_terms): Rename 'work_list' to
  15703. 'work_stack'.
  15704. Use VARRAY_PUSH and VARRAY_TOP to access 'work_stack' instead of
  15705. maintaining the stack pointer in 'work_list_top'.
  15706. Remove code to grow 'work_stack'.
  15707. Remove references to 'work_list_top'.
  15708. Replace references to 'ref_symbols_list' with 'referenced_symbols'.
  15709. (build_fud_chains): Replace references to 'ref_symbols_list' with
  15710. 'referenced_symbols'.
  15711. (search_fud_chains): If there are no variable references in the
  15712. basic block, return early.
  15713. Change usage of linked lists with variable arrays.
  15714. 2001-09-07 Diego Novillo <dnovillo@redhat.com>
  15715. * tree-cfg.c (tree_find_basic_blocks): Document how to traverse
  15716. trees inside a basic block.
  15717. (make_for_stmt_blocks): Make sure that there is always a block for
  15718. FOR_EXPR, even if the loop does not have an expression.
  15719. Create a separate block for FOR_INIT_STMT.
  15720. (make_while_stmt_blocks): Always create an "end_while" block.
  15721. (make_if_stmt_blocks): Do not store IF_COND in the header block of
  15722. an IF statement.
  15723. (make_for_stmt_edges): Create an edge from the block header to the
  15724. block for FOR_INIT_STMT.
  15725. Determine the first block of the loop body calling BB_FOR_STMT on
  15726. the first executable statement in the body.
  15727. Remove the special case for missing FOR_EXPR trees.
  15728. (make_while_stmt_edges): Create a back edge from the end_while
  15729. block to the header block.
  15730. Determine the first block of the loop body calling BB_FOR_STMT on
  15731. the first executable statement in the body.
  15732. (make_do_stmt_edges): Determine the first block of the loop body
  15733. calling BB_FOR_STMT on the first executable statement in the body.
  15734. (condition_block): Rename to latch_block. Return the latch
  15735. block for the given loop header.
  15736. (make_continue_stmt_edges): Rename condition_block to
  15737. latch_block.
  15738. (successor_block): Ditto.
  15739. * tree-flow.h (condition_block): Rename to latch_block.
  15740. 2001-09-06 Diego Novillo <dnovillo@redhat.com>
  15741. * tree-dfa.c (tree_find_varrefs): Use TDF_REFS instead of TDF_VARREF.
  15742. * tree-flow.h (TDF_VARREF): Remove.
  15743. 2001-09-04 Nathan Sidwell <nathan@codesourcery.com>
  15744. * c-common.h (tree_dump_index): Add more comments.
  15745. (TDF_REFS): New dump flag.
  15746. * c-dump.c (dump_files): Name flags `tree' rather than `ast'.
  15747. (dump_option_value_info): New struct.
  15748. (dump_options): New array.
  15749. (dump_switch_p): Parse switch options symbolically.
  15750. * doc/invoke.texi (-fdump-ast): Rename to ...
  15751. (-fdump-tree): ... here. Document options are symbolic, and
  15752. not all are applicable. Combine ssa related flags into the other
  15753. tree dump flags.
  15754. 2001-08-27 Diego Novillo <dnovillo@redhat.com>
  15755. * Makefile.in (tree-ssa.o): Update dependencies.
  15756. (tree-cfg.o): Ditto.
  15757. (tree-dfa.o): Ditto.
  15758. (tree-optimize.o): Ditto.
  15759. 2001-08-26 Diego Novillo <dnovillo@redhat.com>
  15760. * Makefile.in (C_AND_OBJC_OBJS): Replace tree-opt.o with
  15761. tree-optimize.o.
  15762. (c-decl.o): Ditto.
  15763. (tree-ssa.o): Ditto.
  15764. (tree-cfg.o): Ditto.
  15765. (tree-dfa.o): Ditto.
  15766. (tree-opt.o): Ditto.
  15767. * c-decl.c: Replace tree-opt.h with tree-optimize.h.
  15768. (c_expand_body): Remove call to init_tree_opt.
  15769. * flow.c (flow_loop_dump): Do not display insn UIDs if this is not
  15770. an RTL basic block.
  15771. * tree-cfg.c: Replace tree-opt.h with tree-optimize.h.
  15772. (block_invalidates_loop): New local function.
  15773. (validate_loops): New function.
  15774. (tree_dump_bb): Display the loop depth of the block.
  15775. * tree-dfa.c: Replace tree-opt.h with tree-optimize.h.
  15776. * tree-flow.h (validate_loops): Declare.
  15777. * tree-opt.c: Rename to tree-optimize.c.
  15778. * tree-opt.h: Rename to tree-optimize.h.
  15779. * tree-optimize.c: Rename from tree-opt.c.
  15780. * tree-optimize.h: Rename from tree-opt.h.
  15781. * tree-ssa.c: Replace tree-opt.h with tree-optimize.h.
  15782. (tree_build_ssa): Call tree_dump_bb instead of tree_debug_bb.
  15783. * cp/Make-lang.in: Replace tree-opt.h with tree-optimize.h.
  15784. 2001-08-20 Diego Novillo <dnovillo@redhat.com>
  15785. * basic-block.h (basic_block): Remove field 'reachable'.
  15786. Add new field 'flags'.
  15787. (BB_REACHABLE): Define.
  15788. * c-common.h (tree_dump_index): Add TDI_cfg, TDI_dot, TDI_ssa.
  15789. * c-decl.c (c_decode_option): Skip '-f' prefix before calling
  15790. dump_switch_p.
  15791. * c-dump.c (dump_file_info): Add entries for -fdump-tree-cfg,
  15792. -fdump-tree-graphviz and -fdump-tree-ssa.
  15793. * flow.c (find_unreachable_blocks): Use BB_REACHABLE bit in bb->flags
  15794. instead of bb->reachable.
  15795. (delete_unreachable_blocks): Ditto.
  15796. * tree-cfg.c: Minor formatting changes throughout the file.
  15797. (DEBUG_TREE_FLOW): Remove.
  15798. (debug_tree_flow): Remove.
  15799. (cfg_dump_file): New local variable.
  15800. (dot_dump_file): New local variable.
  15801. (cfg_dump_flags): New local variable.
  15802. (dot_dump_flags): New local variable.
  15803. (tree_find_basic_blocks): Remove unused arguments.
  15804. Add code to react to -fdump-tree-cfg and -fdump-tree-graphviz.
  15805. Remove uses of DEBUG_TREE_FLOW.
  15806. (delete_unreachable_blocks): Use BB_REACHABLE bit in bb->flags
  15807. instead of bb->reachable.
  15808. (tree_dump_cfg): New.
  15809. (tree_debug_cfg): Call tree_dump_cfg().
  15810. (tree_cfg2dot): Accept a FILE pointer instead of a file name as
  15811. argument.
  15812. Name the graph with the current function name.
  15813. * tree-dfa.c: Minor formatting changes throughout the file.
  15814. (DEBUG_TREE_DFA): Remove.
  15815. (debug_tree_dfa): Remove.
  15816. (dump_file): New local variable.
  15817. (dump_flags): New local variable.
  15818. (tree_find_varrefs): Add code to react to -fdump-tree-ssa.
  15819. Remove uses of DEBUG_TREE_DFA.
  15820. (find_refs_in_expr): Remove uses of DEBUG_TREE_DFA.
  15821. (create_varref): Replace VARREF_BLOCK with VARREF_BB.
  15822. * tree-flow.h: Minor formatting changes throughout the file.
  15823. (VARREF_BLOCK): Rename to VARREF_BB.
  15824. (VARREF_NEXT): Remove.
  15825. (VARREF_PREV): Remove.
  15826. (TDF_VARREF): Define.
  15827. (tree_find_basic_blocks): Remove unused arguments.
  15828. (tree_dump_cfg): Declare.
  15829. (tree_cfg2dot): Change argument to FILE *.
  15830. * tree-opt.c: Minor formatting changes throughout the file.
  15831. (optimize_tree): Remove unused arguments in call to
  15832. tree_find_basic_blocks().
  15833. * tree-opt.h: Ditto.
  15834. * tree-ssa.c: Minor formatting changes throughout the file.
  15835. (DEBUG_TREE_SSA): Remove.
  15836. (debug_tree_ssa): Remove.
  15837. (dump_file): New local variable.
  15838. (dump_flags): New local variable.
  15839. (tree_build_ssa): Add code to react to -fdump-tree-ssa.
  15840. Remove uses of DEBUG_TREE_SSA.
  15841. (insert_phi_terms): Remove uses of DEBUG_TREE_SSA.
  15842. * doc/invoke.texi: Add documentation for -fdump-tree-cfg,
  15843. -fdump-tree-graphviz and -fdump-tree-ssa.
  15844. Replace existing references to -fdump-tree with -fdump-ast.
  15845. 2001-08-10 Diego Novillo <dnovillo@redhat.com>
  15846. * basic-block.h (basic_block): Add new field 'reachable'.
  15847. (expunge_block): Declare.
  15848. * flow.c (ENTRY_BLOCK_PTR): Initialize field 'reachable'.
  15849. (EXIT_BLOCK_PTR): Ditto.
  15850. (expunge_block): Remove static declaration.
  15851. (cleanup_cfg): Clear bb->aux on every basic block.
  15852. (find_unreachable_blocks): Use field 'reachable' when computing
  15853. reachability.
  15854. (delete_unreachable_blocks): Use field 'reachable'.
  15855. * tree-cfg.c: Rename all instance of 'node' with 'block.
  15856. (get_successor_block): Rename to successor_block.
  15857. (make_compound_stmt_edges): Remove.
  15858. (make_switch_stmt_edges): Remove.
  15859. (delete_unreachable_blocks): New.
  15860. (delete_block): New.
  15861. (make_blocks): Add new argument 'compound_stmt'. Do not include
  15862. COMPOUND_STMT trees in the flowgraph.
  15863. (make_for_stmt_blocks): Include FOR_INIT_STMT in the entry block of
  15864. the loop.
  15865. If FOR_COND does not exist, create a tree holding the constant 1.
  15866. Add new argument 'compound_stmt'.
  15867. (make_while_stmt_blocks): Include WHILE_COND in the entry block of
  15868. the loop.
  15869. Add new argument 'compound_stmt'.
  15870. (make_do_stmt_blocks): Add new argument 'compound_stmt'.
  15871. (make_if_stmt_blocks): Add new argument 'compound_stmt'.
  15872. Include IF_COND in the IF header block.
  15873. (make_switch_stmt_blocks): Add new argument 'compound_stmt'.
  15874. Include SWITCH_COND in the SWITCH header block.
  15875. (create_maximal_bb): Remove argument 'is_loop_header'.
  15876. Add new argument 'compound_stmt'.
  15877. Update all callers.
  15878. Return the newly created basic block instead of its last statement.
  15879. Update comments.
  15880. Do not store control flow altering statements in bb->exit_stmt.
  15881. Only add executable statements to the block.
  15882. Annotate with 'compound_stmt' each tree added to the block.
  15883. (create_bb): Do not update annotation 'is_loop_header'.
  15884. (make_edges): Remove naive reachability analysis.
  15885. When a label node is found, add an edge from the immediately
  15886. enclosing switch statement.
  15887. Call delete_unreachable_blocks() after adding all the edges.
  15888. (make_ctrl_stmt_edges): Do not consider COMPOUND_STMT trees.
  15889. Do nothing for SWITCH_STMT trees.
  15890. (make_exit_edges): Use bb->end_tree instead of BB_EXIT_STMT.
  15891. (make_for_stmt_edges): Remove code that added edges for the block
  15892. holding FOR_INIT_STMT.
  15893. Update comments.
  15894. Do not consider the case where FOR_COND is NULL.
  15895. Call first_exec_stmt() to determine if FOR_BODY is empty.
  15896. Only create an edge from expr_bb to cond_bb if FOR_EXPR is
  15897. non-null.
  15898. (make_while_stmt_edges): Remove code that added edges for the block
  15899. holding WHILE_COND.
  15900. Update comments.
  15901. Call first_exec_stmt() to determine if WHILE_BODY is empty.
  15902. (make_do_stmt_edges): Call first_exec_stmt() to determine if
  15903. DO_BODY is empty.
  15904. (make_if_stmt_edges): Remove code that added edges for the block
  15905. holding IF_COND.
  15906. Call first_exec_stmt() to determine if THEN_CLAUSE or ELSE_CLAUSE
  15907. are empty.
  15908. (make_switch_stmt_edges): Remove.
  15909. (make_goto_stmt_edges): Use bb->end_tree instead of BB_EXIT_STMT.
  15910. (make_break_stmt_edges): Use bb->end_tree instead of BB_EXIT_STMT.
  15911. Call switch_parent() and loop_parent() to determine if the
  15912. statement is inside an appropriate control structure.
  15913. (make_continue_stmt_edges): Use bb->end_tree instead of
  15914. BB_EXIT_STMT.
  15915. (make_return_stmt_edges): Ditto.
  15916. (get_successor_block): Rename to successor_block.
  15917. Call first_exec_stmt() to find the first executable statement in
  15918. TREE_CHAIN.
  15919. (is_ctrl_stmt): Do not consider COMPOUND_STMT trees.
  15920. (stmt_starts_bb_p): Ditto.
  15921. (stmt_ends_bb_p): Reformat comments.
  15922. (delete_cfg): Reformat comments.
  15923. (find_loop_parent): Rename to loop_parent.
  15924. (get_condition_block): Rename to condition_block.
  15925. Update to use new index numbers for control structure header
  15926. blocks.
  15927. (switch_parent): New.
  15928. (first_exec_stmt): New.
  15929. (is_exec_stmt): New.
  15930. (tree_cfg2dot): Reformat comments.
  15931. * tree-dfa.c (find_refs): Remove.
  15932. (find_refs_in_stmt): New
  15933. (find_refs_in_stmt_expr): New.
  15934. (tree_find_varrefs): Look for variables doing a CFG traversal
  15935. instead of the trees. Remove both arguments.
  15936. (find_refs_in_expr): Add new argument 'bb'.
  15937. Update all recursive calls.
  15938. (create_varref): Abort if the basic block 'bb' is NULL.
  15939. (add_ref_to_sym): Reformat comments.
  15940. (add_ref_symbol): Ditto.
  15941. (delete_varref_list): Ditto.
  15942. * tree-flow.h (struct tree_ann_def): Add 'compound_stmt'.
  15943. (TREE_COMPOUND_STMT): New macro.
  15944. (struct basic_block_ann_def): Remove 'exit_stmt' and
  15945. 'is_loop_header'.
  15946. (BB_EXIT_STMT): Remove.
  15947. (BB_IS_LOOP_HEADER): Remove.
  15948. * tree-opt.c (optimize_tree): Call tree_find_varrefs() with no
  15949. arguments.
  15950. Only build DFA and SSA information if n_basic_blocks is greater
  15951. than zero.
  15952. * tree-ssa.c: Rename all instances of 'node' with 'block'.
  15953. (tree_build_ssa): Reformat comments.
  15954. (insert_phi_terms): Ditto.
  15955. 2001-08-01 Diego Novillo <dnovillo@redhat.com>
  15956. * tree-cfg.c (USE_TREE_IL): Remove.
  15957. (make_back_edges): Remove.
  15958. (make_fallthru_edge): Remove.
  15959. (get_outermost_scope_block): Remove.
  15960. (is_last_block_of_loop): Remove.
  15961. (tree_find_basic_blocks): Do not return early if 'errorcount' is set.
  15962. (make_edges): Do not treat back edges as a separate case.
  15963. Do not call make_fallthru_edge to create fall-through edges.
  15964. Do not emit a warning for unreachable blocks containing a single
  15965. closing brace.
  15966. (make_do_stmt_edges): Update comment.
  15967. (make_goto_stmt_edges): Do not call get_outermost_scope_block().
  15968. (make_break_stmt_edges): Do not call get_outermost_scope_block().
  15969. Do not call make_back_edges().
  15970. (make_continue_stmt_edges): Call find_loop_parent(). Emit an error
  15971. if the 'continue' statement is not inside a loop. Call
  15972. get_condition_block() to find the target node.
  15973. (make_return_stmt_edges): Do not call get_outermost_scope_block().
  15974. (get_successor_block): Return EXIT_BLOCK_PTR if 'bb' is the last
  15975. block in the graph.
  15976. Return the condition node of the loop if 'bb' doesn't have a
  15977. natural successor and its parent is a loop header.
  15978. (tree_cfg2dot): Output fake edges with dotted lines.
  15979. * tree-dfa.c (USE_TREE_IL): Remove.
  15980. * tree-opt.c (USE_TREE_IL): Remove.
  15981. * tree-ssa.c (USE_TREE_IL): Remove.
  15982. * tree-flow.h (is_last_block_of_loop): Remove.
  15983. 2001-07-23 Diego Novillo <dnovillo@redhat.com>
  15984. * Makefile.in (C_AND_OBJC_OBJS): Add tree-cfg.o, tree-dfa.o,
  15985. tree-ssa.o and tree-opt.o.
  15986. (c-decl.o): Add dependency on tree-opt.h
  15987. (tree-ssa.o): New rule.
  15988. (tree-cfg.o): New rule.
  15989. (tree-dfa.o): New rule.
  15990. (tree-opt.o): New rule.
  15991. * c-decl.c: Include tree-opt.h.
  15992. (c_expand_body): Call optimize_tree() when the -ftree-ssa flag is
  15993. given.
  15994. * flags.h (flag_tree_ssa): Declare.
  15995. * toplev.c (flag_tree_ssa): Define.
  15996. (lang_independent_options): Add -ftree-ssa.
  15997. * tree-cfg.c: New file.
  15998. * tree-dfa.c: New file.
  15999. * tree-flow.h: New file.
  16000. * tree-opt.c: New file.
  16001. * tree-opt.h: New file.
  16002. * tree-ssa.c: New file.
  16003. * cp/Make-lang.in (CXX_C_OBJS): Add tree-cfg.o, tree-dfa.o,
  16004. tree-opt.o and tree-ssa.o.
  16005. * doc/invoke.texi: Add documentation for -ftree-ssa.
  16006. 2001-07-23 Nathan Sidwell <nathan@codesourcery.com>
  16007. * Makefile.in (calls.o): Depend on intl.h.
  16008. * calls.c: Include intl.h.
  16009. (ECF_NEED_STACK_FRAME, ECF_NEED_ARG_FRAME): New flags.
  16010. (special_function_p): Detect when we need a stack or arg
  16011. frame. Don't optimize on length.
  16012. (setjmp_call_p): Remove.
  16013. (uninlinable_call_p): New function.
  16014. * tree.h (setjmp_call_p): Remove.
  16015. (uninlinable_call_p): Declare.
  16016. 2001-07-22 Nathan Sidwell <nathan@codesourcery.com>
  16017. * params.def (PARAM_MAX_INLINE_AST): New parameter.
  16018. (PARAM_ARG_INLINE_AST): New parameter.
  16019. * doc/invoke.texi (max-inline-ast, arg-inline-ast): Document
  16020. parameters.
  16021. Local Variables:
  16022. mode: change-log
  16023. change-log-default-name: "ChangeLog.tree-ssa"
  16024. End:
  16025. Copyright (C) 2001-2004 Free Software Foundation, Inc.
  16026. Copying and distribution of this file, with or without modification,
  16027. are permitted in any medium without royalty provided the copyright
  16028. notice and this notice are preserved.