From: Maarten B. <sou...@ds...> - 2004-07-20 14:17:01
|
> > Yes, I can. And I already did. It's about the next parts mentioned > > here. Your first answer was "Yes": "d &= ~1" results in "d = d & > > 0x0000fffeL" Your second answer was "No, everthing is ok": "d &= ~1" > > results in "d = d & 0xfffffffeL" > Ah, ok, now I see it. You're right und I was wrong. > > "d &= ~1" should result in "d = d & 0xfffffffeL" > independently from d being 'long' or 'unsigned long'. > > I can't reproduce the incorrect code any more. If you've an example, > which shows buggy code, I'd like to see it. It cannot be reproduced with the original code. It was part of the discussion what happens if we DON'T cast the result of ~ on a literal signed, but DO cast ALL literal chars to int (see SDCCval.c valComplement). A path I explored because what's currently there seems (feels) buggy, but actually gives very good results as it turns out. It was one of the ways to get the compiler to produce the optimal output for the original problem. I was not certain what the exact behaviour should be, that's why I popped the question. After rereading the (unreadable) standard over and over, we've now agreed on what the code should behave like. |