Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

GCC 4.6.x invalid code generation (Developers)

posted by Rugxulo Homepage, Usono, 10.04.2012, 05:58

> But there are still used and manufactured various low-power embedded PCs
> with old and simple x86 core like vortex86 and other SoC with 386/486 core,
> even may lack FPU. Linux can run on such machines well so they should
> care...

GCC has always assumed an FPU, I think. But also I think Linux kernel has CMOV emulation (presumably via trapping SIGILL), so maybe that's why they don't care, it should always work. Even Clang (I think?) by default targets P4 w/ SSE2.

> Running the program is not enough good test. Code may branch widely
> depending on input data so you don't have a chance to test all the code
> runtime...

True, but I don't know of a better way.

> As you can see from file dates I use updated/CVS DJDEV. But now I become
> suspicious to objdump. It detected CMOVs in libm.a even from very old djdev
> 2.03. I tried older 3.x GCC and still getting CMOVs in some object files. I
> also found, that X264 use CMOV in some assembler source modules so it
> cannot be disabled. So this may be the reason why FFMPEG crashed on some
> compression target and din't crashed on other. But as I said I found CMOV
> also in .o files compiled from .c files that doesn't have inline ASM or
> anything else indicating CMOV. Even more confusing is that CMOV was
> produced also with GCC 3.x. When I tried to compile .C file into assembler
> .S file I didn't see CMOV there. So objdump is just kidding me or WTF? It
> seem's the right time to go sleep now... :P

Dunno, try gcc281b.zip, and see what happens. It shouldn't make any CMOVs ... ever! ;-)

I honestly only know about such regression in 4.6.x, so I would personally trust older versions. However, it's impossible to tell, but I'm not worried (at least without better proof). So I suggest you also not worry. I know it's not much reassurance, esp. from me, but it's all I've got. Also, 4.5.3 is presumably "good enough" for your needs until a fix is found. :-)

EDIT: If it were me, I'd totally revert to a non-buggy patch in GCC trunk, but alas it's not my call (and obviously I don't have repo write access). Also, I think CMOV optimizations are hugely overrated, but silly GCC is obsessed with them for whatever reason.

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum