can/should autoincrement get optimized away?

2008-04-14 Thread John Breitenbach
I finally got to the bottom of some unexpected behavior from the amreb-linux target of the 4.1.2 compiler. I'm hoping that someone can say if is this an optimization bug (optimizes away too much) or a problem with this code. extern int ReadChar( char *p); /* grab a character from input

Re: can/should autoincrement get optimized away?

2008-04-14 Thread Jim Wilson
John Breitenbach wrote: char can't be less-than zero. However, can't make up my mind as to whether or not it should be allowed to optimize away the post-increment. It is not OK to optimize away the post-increment. This is a gcc optimization bug. Jim