This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2] Add uaddv_optab, usubv4_optab
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Richard Henderson <rth at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Eric Botcazou <ebotcazou at libertysurf dot fr>, Jakub Jelinek <jakub at redhat dot com>, Uros Bizjak <ubizjak at gmail dot com>
- Date: Sun, 22 Nov 2015 10:57:40 -0600
- Subject: Re: [PATCH v2] Add uaddv_optab, usubv4_optab
- Authentication-results: sourceware.org; auth=none
- References: <56519B27 dot 7080704 at redhat dot com>
Hi Richard,
On Sun, Nov 22, 2015 at 11:38:31AM +0100, Richard Henderson wrote:
> One of which I believe I've worked around in the i386 backend, but I
> believe to be a latent problem within combine.
>
> With the following patch, disable the add<mode>3_*_overflow_2 patterns.
> Then compile c-c++-common/torture/builtin-arith-overflow-4.c with -O2 and
> you'll see
>
> t151_2add:
> testb %dil, %dil
> leal -1(%rdi), %eax
> jne .L644
>
> which is incorrect. Combine has looked through two comparisons, seen the
> NE in the second comparison, and then converted a CCCmode compare to a
> CCZmode compare.
It sees the *first* comparison, and its use, and has simplified that.
As far as I see, anyway. (It will never look outside a basic block,
combine isn't *that* scary!)
0xff + x < 0xff (everything as unsigned char) is the same as x != 0 .
Segher