From 1fef7e4b6c3fc653f597232c4c785afa5419202e Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 30 Jan 2011 16:32:50 +0000 Subject: [PATCH] + introduces vo_volatile for variables, the node cse optimizer takes care of it git-svn-id: trunk@16851 - --- compiler/optcse.pas | 10 +++++++--- compiler/symconst.pas | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/optcse.pas b/compiler/optcse.pas index 4e33b89e32..221b0d7388 100644 --- a/compiler/optcse.pas +++ b/compiler/optcse.pas @@ -57,12 +57,12 @@ unit optcse; procinfo, nbas,nld,ninl,ncal,ncnv,nadd, pass_1, - symconst,symtype,symdef, + symconst,symtype,symdef,symsym, defutil, optbase; const - cseinvariant : set of tnodetype = [loadn,addn,muln,subn,divn,slashn,modn,andn,orn,xorn,notn,vecn, + cseinvariant : set of tnodetype = [addn,muln,subn,divn,slashn,modn,andn,orn,xorn,notn,vecn, derefn,equaln,unequaln,ltn,gtn,lten,gten,typeconvn,subscriptn, inn,symdifn,shrn,shln,ordconstn,realconstn,unaryminusn,pointerconstn,stringconstn,setconstn, isn,asn,starstarn,nothingn,temprefn,loadparentfpn {,callparan}]; @@ -71,7 +71,11 @@ unit optcse; begin if (n.nodetype in cseinvariant) or ((n.nodetype=inlinen) and - (tinlinenode(n).inlinenumber in [in_assigned_x]) + (tinlinenode(n).inlinenumber in [in_assigned_x]) + ) or + ((n.nodetype=loadn) and + not((tloadnode(n).symtableentry.typ in [staticvarsym,localvarsym,paravarsym]) and + (vo_volatile in tabstractvarsym(tloadnode(n).symtableentry).varoptions)) ) then result:=fen_true else diff --git a/compiler/symconst.pas b/compiler/symconst.pas index cacf03406a..011fbe37a7 100644 --- a/compiler/symconst.pas +++ b/compiler/symconst.pas @@ -422,7 +422,8 @@ type { Objective-C message selector parameter } vo_is_msgsel, { first field of variant part of a record } - vo_is_first_field + vo_is_first_field, + vo_volatile ); tvaroptions=set of tvaroption;