From: SourceForge.net <no...@so...> - 2005-03-01 07:19:24
|
Bugs item #1144613, was opened at 2005-02-20 02:23 Message generated for change (Settings changed) made by maartenbrock You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1144613&group_id=599 >Category: C-Front End Group: None Status: Open >Resolution: Accepted Priority: 5 Submitted By: Bill Goodman (bgoodman) >Assigned to: Maarten Brock (maartenbrock) Summary: "critical" keyword for 8051 is broken Initial Comment: The "critical" keyword no longer generates correct code. This worked in the 2004-08-06 snapshot and is broken in the 2005-02-19 snapshot. I suspect the critical optimization implemented 2004-11-18 may be the culprit. Using the command line: sdcc main.c With this "main.c": int x; void main (void) { while (1) { critical { x = 1; } } } This generates this code: 125 ; genCritical 0008 74 01 126 mov a,#0x01 000A 10 AF 01 127 jbc ea,00107$ 128 ; Peephole 181 changed mov to clr 000D E4 129 clr a 000E 130 00107$: 131 ;main.c:9: x = 1; 132 ; genAssign 000E 75 08 01 133 mov _x,#0x01 0011 E4 134 clr a 0012 F5 09 135 mov (_x + 1),a 136 ; genEndCritical 0014 13 137 rrc a 0015 92 AF 138 mov ea,c This saves the current interrupt enable state in A but never saves it anywhere. The end critical code just loads it from A which has been modified by intervening code. Bill Goodman ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1144613&group_id=599 |