From: bernhardheld Date: Sun, 11 Dec 2005 21:31:17 +0000 (+0000) Subject: * src/SDCCicode.c (fgeniCodeAssign): fixed bug 1369874, don't use volatile variables... X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=69446b0469baf2877e1baf54a54d30f9fb8a8e16;p=fw%2Fsdcc * src/SDCCicode.c (fgeniCodeAssign): fixed bug 1369874, don't use volatile variables as spill location git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4007 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 27f22d3c..daa3404e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-12-10 Bernhard Held + + * src/SDCCicode.c (fgeniCodeAssign): fixed bug 11369874, don't use + volatile variables as spill location + 2005-12-10 Bernhard Held * src/SDCCcse.c (findCheaperOp): fixed bug 1376320, copy signedness to diff --git a/src/SDCCicode.c b/src/SDCCicode.c index 5827d4e5..513c7b6c 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -3264,12 +3264,16 @@ geniCodeAssign (operand * left, operand * right, int nosupdate, int strictLval) isOperandGlobal (left)) { symbol *sym = NULL; + operand *newRight; if (IS_TRUE_SYMOP (right)) sym = OP_SYMBOL (right); ic = newiCode ('=', NULL, right); - IC_RESULT (ic) = right = newiTempOperand (ltype, 0); - SPIL_LOC (right) = sym; + IC_RESULT (ic) = newRight = newiTempOperand (ltype, 0); + /* avoid double fetch from volatile right, see bug 1369874 */ + if (!isOperandVolatile (right, FALSE)) + SPIL_LOC (newRight) = sym; + right = newRight; ADDTOCHAIN (ic); }