1 Nov 2005 17:30
Re: jhc vs ghc and the surprising result involving ghc generated assembly.
Florian Weimer <fw <at> deneb.enyo.de>
2005-11-01 16:30:55 GMT
2005-11-01 16:30:55 GMT
* John Meacham: > loop: > > if () goto loop; > > is not equivalent to a do-while loop, loop invarients cannot be hoisted out of > the above for instance (except in some cases... it is all quite tricky and we > want gcc to have as much freedom as possible). do-while loops are converted to this form by the compiler (as of version 4, use the -fdump-tree-* to see the IL), so the problems you are observing must be caused by something different. > use C control constructs rather than gotos. With GCC version 4, this will have no effect because the gimplifier converts everything to goto-style anyway.
> Felix generated C(++) code -- compiled with same options:
>
> int FLX_REGPARM _i1860_f1301_ack(
> int _i1864_v1303_x, int _i1865_v1304_y)
> {
> _us2 _i1867_v1799_ack_mv_74;
> _us2 _i1868_v1821_ack_mv_84;
_us2 is unsigned, correct?
BTW, you shouldn't generate identifiers with leading underscores
because they are reserved for the implementation.
> I have no real idea why the Felix generated C is faster.
> Two guesses:
>
> (a) the two 'mv' variables declared at the top are optimised
> away, so the Felix version is only using 3 words of stack.
RSS Feed