------- Comment #1 from nmiell at comcast dot net 2006-11-10 06:59 ------- Created an attachment (id=12585) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12585&action=view) little C demonstration
This is a test function in C that demonstrate a case where gcc could be using JrCXZ and isn't. Ignore the warnings about a call-clobbered register being used as a global, that was done in order to force the register allocator into using the rCX register so that the missed optimization can be demonstrated. gcc generates: subq $8, %rsp testq %rcx, %rcx je .L4 call abort .L4: addq $8, %rsp ret when it could be generating: subq $8, %rsp jrcxz .L4 call abort .L4: addq $8, %rsp ret -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29793