From: SourceForge.net <no...@so...> - 2007-06-20 12:04:26
|
Bugs item #1738367, was opened at 2007-06-16 16:33 Message generated for change (Comment added) made by frief You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1738367&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: C-Front End Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Maarten Brock (maartenbrock) Assigned to: Maarten Brock (maartenbrock) Summary: bit returned in dpl Initial Comment: The following code still generates code that returns a bit in dpl for the mcs51. bit Ternary(unsigned char status) { return (status == 0) ? 0 : 1; } _Ternary: ar2 = 0x02 ar3 = 0x03 ar4 = 0x04 ar5 = 0x05 ar6 = 0x06 ar7 = 0x07 ar0 = 0x00 ar1 = 0x01 ; genReceive ; heaters.c:6: return (status == 0) ? 0 : 1; ; genNot ; peephole 177.g optimized mov sequence mov a,dpl mov r2,a cjne a,#0x01,00105$ 00105$: clr a rlc a ; genNot mov r2,a ; Peephole 105 removed redundant mov cjne a,#0x01,00106$ 00106$: clr a rlc a mov dpl,a ; genRet ; Peephole 500 removed redundant label 00101$ ret Not to mention the unoptimized code. ---------------------------------------------------------------------- >Comment By: Frieder Ferlemann (frief) Date: 2007-06-20 14:04 Message: Logged In: YES user_id=589052 Originator: NO I'm attaching a file which allows to reproduce the bug within the regression test suite. Note, older versions of SDCC (I tested with SDCC 2.7.1 #4827) pass the test whereas uptodate versions do not. Greetings, Frieder File Added: bug1738367.c ---------------------------------------------------------------------- Comment By: Frieder Ferlemann (frief) Date: 2007-06-17 10:32 Message: Logged In: YES user_id=589052 Originator: NO These would fail too: return (status == 0) ? 1 : 0; return !status ? 1 : 0; return status ? 0 : 1; ---------------------------------------------------------------------- Comment By: Maarten Brock (maartenbrock) Date: 2007-06-16 23:20 Message: Logged In: YES user_id=888171 Originator: YES Seems it was not fixed at all. The following still fails: return (status == 0) ? (bit)0 : (bit)1; ---------------------------------------------------------------------- Comment By: Maarten Brock (maartenbrock) Date: 2007-06-16 16:53 Message: Logged In: YES user_id=888171 Originator: YES Fixed in SDCC 2.7.2 #4854. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1738367&group_id=599 |