Does any one else have problems with the higher levels of optimisation available to C51? With common block subroutines switched on, sometimes, just sometimes, C51 will generate completely wrong code. I have noticed that the problems are often associated with pointers that are automatic variables and where there is a variable of the same name in another function. Common block subroutines have a dramatic affect on code size, but I don't use this level of optimisation because it just does not seem to be reliable.
This is not a problem of C51, but from the LX51 Linker/Locater. Which LX51 version are you using.
We are using LX51 version 3.51.
"This is not a problem of C51, but from the LX51 Linker/Locater." So it is a problem, then?
Graham, When I first switched to using LX51 I tried optimisation levels 10 and 11 (with "Favour size" selected) and encountered some problems with previously working code. I didn't bother to investigate, however, because I found that the code size in all three projects tested actually grew by about 0.5% with level 11 as opposed to level 9. Have you found these additional optimisation levels to be of any benefit (when they work)? Stefan
Stefan: how well does each level of optimisation work? I performed an experiment using my current development project and built it with various possible levels of optimisation in order to find out. The project is pretty typical, it has no floating point and has ANSI promotion turned on for about 50% of the code. Linker code packing is enabled.
Optimisation Favour Favour Difference Difference from level 8 Level Speed Size for size Speed Size 8 59288 56882 4.06% 00.0% 00.0% 9 49502 48358 2.31% 16.5% 15.0% 10 49499 48417 2.18% 16.5% 14.9% 11 49499 48417 2.18% 16.5% 14.9%
Graham, "whereas levels 10 and 11 have very little to offer" Indeed, you're seeing a slight increase in code size over level 9 with 'Favour size' as I am. My projects all use a great deal of floating point, I build with linker code packing on and integer promotion off. Perhaps Keil would like to comment on whether there are any specific situations where 10 and 11 make a significant improvement? Stefan
"Perhaps Keil would like to comment on whether there are any specific situations where 10 and 11 make a significant improvement?" Apparently not. Is this because levels 10 and 11 are in fact a marketing gimmick? "So it is a problem, then?" Presumably silence means 'yes'? Look Keil, we understand that there will be bugs in your software from time to time. In general your tools are of a very high quality and very well supported. But please, when there is a problem we want to know what it is, what it affects and when it will be fixed. At a minimum please describe bug fixes in detail in your version release notes. Stefan
"please describe bug fixes in detail in your version release notes." I've been moaning about the lack of information in the so-called "release notes" for ages! I think all the "release notes" for all the 6.xx versions were identical apart from the value of the "xx"!!! (yes, I even did a text compare once!) Things have improved recently, but there's still a way to go; eg proper documentation of bugs/issues fixed, and known issues remaining.
We can confirm that your problem is most likely fixed in the current version. Take a look to http://www.keil.com/update/_c51/c51v703a.htm which are the release notes of the current revision. In the first item under V7.02 we refer to the fact that we have corrected some problems with linker code packing.