This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] pr53138 - miscompilation of spaceship operator
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 27 Apr 2012 12:03:21 +0200
- Subject: Re: [PATCH] pr53138 - miscompilation of spaceship operator
- References: <1335520168-28993-1-git-send-email-bonzini@gnu.org>
On Fri, Apr 27, 2012 at 11:49 AM, Paolo Bonzini <bonzini@gnu.org> wrote:
> The testcase is miscompiled to this:
>
> ? ? ? ?...
> ? ? ? ?movl ? ?(%rsi), %ecx
> ? ? ? ?cmpl ? ?%ecx, (%rdi)
> ? ? ? ?sbbl ? ?%edx, %edx
> ? ? ? ?cmovbe ?%edx, %eax
> ? ? ? ?ret
>
> but sbbl only preserves the carry flag, not the zero flag. ?I suppose
> one could use different patterns with different CC modes, but this is
> the safest fix.
>
> Bootstrapped/regtested x86_64-pc-linux-gnu, ok for mainline?
OK.
> I also reproduced this at least on 4.7; help would be welcome on
> committing it to the branches. Thanks in advance!
I can take care of this, but I won' be able to do this until Monday.
Thanks,
Uros.