From: SourceForge.net <no...@so...> - 2012-02-02 08:22:46
|
Bugs item #3482217, was opened at 2012-01-31 06:41 Message generated for change (Comment added) made by tecodev You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3482217&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: Live range problems Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Bogdan Pawlak (skorpionx) Assigned to: Nobody/Anonymous (nobody) Summary: Postincrement working incorrect! Initial Comment: I use for my PIC18f258 the SDCC Compiler. I use Snapshot Versions from http://sdcc.sourceforge.net/snap.php sdcc-snapshot-i586-mingw32msvc-20120131-7268.zip 8524 K Jan 31 09:31 Postincrement working incorrect! .... unsigned char VarBuffer[10], *BytePointer; BytePointer = VarBuffer; *BytePointer++ = 1; //BytePointer to be not incrementiert! ---------------------------------------------------------------------- >Comment By: Raphael Neider (tecodev) Date: 2012-02-02 00:22 Message: This affects all ports: Using the attached file with a (global) BytePointer, even sdcc b3482217.c --i-code-in-asm --nogcse --nooverlay --nolabelopt --noinvariant --noinduction --nojtbound --noloopreverse --no-peep --dumpall -c looses the pointer increment (in both functions) somewhere during i-code optimization: in .dumppack, .dumprange and .dumprassgn the increment i-code is gone, all other .dump* (still) include it. ---------------------------------------------------------------------- Comment By: David Cary (davidcary5) Date: 2012-01-31 10:04 Message: The line "*BytePointer++ = 1;" should act the same as "*(BytePointer++) = 1;". The post-increment (++) has a higher precedence than the indirection (*), so after running that line VarBuffer[0] *should* be set to 1, and BytePointer *should* be incremented to point to VarBuffer[1]. Is that what you are seeing, or are you seeing something more like "(*BytePointer)++" ? http://en.wikibooks.org/wiki/C_Programming/Reference_Tables#Table_of_Operators ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3482217&group_id=599 |