This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
unsigned short f (short a) { short b;
if (a > 0) return 0; b = ((int) a) + - (int) 32768; return b; }
For a = 0, that seems to be the correct result.
For a = -1, the original wants to do b = -32769, which seems undefined, and thus the result is correct. Similarly for even more negative a.
Where is the actual bug here?
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |