This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR69595, bogus -Warray-bound warning
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 15 Feb 2016 14:48:57 +0100 (CET)
- Subject: Re: [PATCH] Fix PR69595, bogus -Warray-bound warning
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1602021139100 dot 31122 at t29 dot fhfr dot qr> <alpine dot DEB dot 2 dot 20 dot 1602140248170 dot 1901 at laptop-mg dot saclay dot inria dot fr> <alpine dot LSU dot 2 dot 11 dot 1602150946330 dot 1392 at t29 dot fhfr dot qr>
On Mon, 15 Feb 2016, Richard Biener wrote:
> On Sun, 14 Feb 2016, Marc Glisse wrote:
>
> > On Tue, 2 Feb 2016, Richard Biener wrote:
> >
> > > *** gcc/match.pd (revision 233067)
> > > --- gcc/match.pd (working copy)
> > > *************** DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
> > > *** 2094,2099 ****
> > > --- 2094,2117 ----
> > > (bit_and:c (ordered @0 @0) (ordered:c@2 @0 @1))
> > > @2)
> > >
> > > + /* Simple range test simplifications. */
> > > + /* A < B || A >= B -> true. */
> > > + (for test1 (lt le ne)
> > > + test2 (ge gt eq)
> > > + (simplify
> > > + (bit_ior:c (test1 @0 @1) (test2 @0 @1))
> > > + (if (INTEGRAL_TYPE_P (TREE_TYPE (@0))
> > > + || VECTOR_INTEGER_TYPE_P (TREE_TYPE (@0)))
> > > + { constant_boolean_node (true, type); })))
> > > + /* A < B && A >= B -> false. */
> > > + (for test1 (lt lt lt le ne eq)
> > > + test2 (ge gt eq gt eq gt)
> >
> > The lack of symmetry between the || and && cases is surprising. Is there any
> > reason not to handle the pairs le/ge, le/ne and ge/ne for bit_ior?
>
> Whoops, no. I simply forgot those. I'll bootstrap/test
Bootstrapped / tested on x86_64-unknown-linux-gnu, applied.
Richard.
> 2016-02-15 Richard Biener <rguenther@suse.de>
>
> PR tree-optimization/69595
> * match.pd: Complete range test simplification to true.
>
> Index: gcc/match.pd
> ===================================================================
> --- gcc/match.pd (revision 233369)
> +++ gcc/match.pd (working copy)
> @@ -2119,8 +2119,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
>
> /* Simple range test simplifications. */
> /* A < B || A >= B -> true. */
> -(for test1 (lt le ne)
> - test2 (ge gt eq)
> +(for test1 (lt le le le ne ge)
> + test2 (ge gt ge ne eq ne)
> (simplify
> (bit_ior:c (test1 @0 @1) (test2 @0 @1))
> (if (INTEGRAL_TYPE_P (TREE_TYPE (@0))
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)