This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Let tree_single_nonzero_warnv_p use VRP
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 24 Apr 2017 09:41:01 +0200
- Subject: Re: Let tree_single_nonzero_warnv_p use VRP
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.02.1704232321030.3335@stedding.saclay.inria.fr>
On Sun, Apr 23, 2017 at 11:38 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> Hello,
>
> this patches teaches tree_expr_nonzero_warnv_p to handle SSA_NAME using
> range information and known (non-)zero bits, by delegating to
> expr_not_equal_to which already knows how to handle all that.
>
> This makes one strict overflow warning disappear. It isn't particularly
> surprising, since the new code makes tree_expr_nonzero_warnv_p return true
> without warning (we do not remember if the range information was obtained
> using strict overflow). In my opinion, improving code generation is more
> important than this specific warning.
>
> Bootstrap+regtest on powerpc64le-unknown-linux-gnu.
Hmm, I think you need to guard this with a INTEGRAL_TYPE_P check
given the comment on tree_single_nonzero_warnv_p also talks about
FP.
Ok wiht that change.
Richard.
> 2017-04-24 Marc Glisse <marc.glisse@inria.fr>
>
> gcc/
> * fold-const.c (tree_single_nonzero_warnv_p): Handle SSA_NAME.
>
> gcc/testsuite/
> * gcc.dg/tree-ssa/cmpmul-1.c: New file.
> * gcc.dg/Wstrict-overflow-18.c: Xfail.
>
> --
> Marc Glisse