How to avoid C compilers problems? - Write in assembly :D [ ]s --------------------------------- Ricardo de Azambuja On Wed, Jul 8, 2009 at 11:37 AM, Carl Denk wrote: > More of an outsiders thoughts of a summary of the supposed experts, for > comment, that's why I noted up front my qualifications. :) > 1: Should a compiler, do a reasonable job of generating code on a line > by line basis, or is this not expected if the targets are a mixed bag of > devices in a family? > 2: When you specify a target device, should the compiler generate > different code, then for a different device? This is excluding hardware > specifics like ADC, EUARTS ,UARTS, etc. which I would assume be handled > correctly for the device. > 3: Should the optimizer then take that code generated on a line by line > basis and improve it by eliminating duplicates, and unnecessary steps? > > It appears numerous examples have been cited where the basic code > generated was less than optimal quality, and as pointed out code size > can be an issue, though I don't recall seeing actual numbers as to, how > much larger the code got. > > > Wouter van Ooijen wrote: >>> Not an area where I have much expertise, but sounds like the original >>> compiler was poorly done, and a lots of patches call optimizers are >>> added. I would think a good compiler, would do a good job, based on >>> individual lines or small groups of lines like a loop of code, and the >>> optimizer would look at more of a macro view, to eliminate duplicate >>> instructions, etc., say where a value is already in a register. >>> >> >> It is not your area of expertise, but you seem to expect that your >> conclusions are valid? >> >> > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist