From: SourceForge.net <no...@so...> - 2004-04-23 05:44:43
|
Bugs item #933966, was opened at 2004-04-12 18:23 Message generated for change (Comment added) made by epetrich You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=933966&group_id=599 Category: Icode generator >Group: fixed >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Erik Petrich (epetrich) Summary: Necessary variable assignments optimized away. Initial Comment: It looks like variable assignments in some cases are being optimized away. I have tried disabling all optimizations but that does not eliminate the problem. The command line used to invoke SDCC is simple: SDCC -c bug01.c SDCC Version displays as: SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51 /ds400/hc08 2.4.0 (Feb 23 2004) (MINGW32) The attached file (bug01.c) contains a simplified version of the code which demonstrates the problem. I have tried this same code on GCC and Microsoft VCC and they both compile the code correctly. The code should be self explanatory but I can be reached at Mark@EverythingEmbedded.com if there are any questions or issues regarding my explanation of this bug. Regards, /mbs ---------------------------------------------------------------------- >Comment By: Erik Petrich (epetrich) Date: 2004-04-23 00:44 Message: Logged In: YES user_id=635249 Fixed; see ChangeLog 1.711 for the list of updated files ---------------------------------------------------------------------- Comment By: Mark Sawyer (mbs1251) Date: 2004-04-13 15:48 Message: Logged In: YES user_id=1019868 RE: Hint: a workaround is to define var1...3 as volatile Thanks for your response. That was the workaround that I came up with. As an aside, I was a little surprised to find that I was unable to fix the problem by disabling all optimizations. /mbs ---------------------------------------------------------------------- Comment By: Bernhard Held (bernhardheld) Date: 2004-04-13 04:40 Message: Logged In: YES user_id=203539 Confirmed, var1...var3 shouldn't be optimized around the call to anyFunc(). The elimination of var4...var6 is ok. Hint: a workaround is to define var1...3 as volatile. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=933966&group_id=599 |