From: Bernhard H. <sdc...@be...> - 2005-10-25 12:02:57
|
Hi Maarten, I'm back on the list to tackle this problem. > Run the mcs51-stack-auto regression test to see bitvars.c fail. Ok, I see. I commited a fix for this problem. But it's a really ugly story: bit arithmethic and promotion rules don't make a good fit. Given this code (check with build 1123): #include <stdbool.h> char complement(bool a); unsigned char _ff = 0xFF; void testBits(void) { complement (~_ff); } In dumpcse the icode is buggy, but after elimination of iTemp0 dumprassgn looks ok. It's an optimization, which (very luckily) hides a bug. The optimization doesn't work with stack-auto, and the bug is exposed. The only clean solution is to introduce promotion for bit variables (this is the ugly part). It was completely missing up to now. The big disadvantage are regressions in code size. At the moment I've got no idea how to improve the code again. But I'll have a 2nd look, hopefully with some new ideas. Hints are welcome! Bernhard |