[Bug 288] strange nonsensical x86-64 code generation with -O3 - rats' nest of useless conditional jumps

gdc-bugzilla at gdcproject.org gdc-bugzilla at gdcproject.org
Thu Mar 22 22:16:16 UTC 2018


https://bugzilla.gdcproject.org/show_bug.cgi?id=288

--- Comment #1 from Iain Buclaw <ibuclaw at gdcproject.org> ---
> See the long list of useless conditional jumps towards the end of the first function in the asm output (whose demangled name is test.t1(unit))

Well, you'd never use -O3 if you care about speed anyway. :-)

And they are not useless jumps, it's just the foreach loop unrolled in its
entirety.  You can see that it's a feature of the gcc-7 series and latter,
irregardless of the target, they all produce the same unrolled loop.

https://explore.dgnu.org/g/vD3N4Y

It might be a nice experiment to add pragma(ivdep) and pragma(unroll) support
to give you more control.

https://gcc.gnu.org/onlinedocs/gcc/Loop-Specific-Pragmas.html

I wouldn't hold my breath though (this is not strictly a bug).

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the D.gnu mailing list