https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81635
--- Comment #13 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> --- Author: rsandifo Date: Thu Feb 1 14:17:07 2018 New Revision: 257296 URL: https://gcc.gnu.org/viewcvs?rev=257296&root=gcc&view=rev Log: Use range info in split_constant_offset (PR 81635) This patch implements the original suggestion for fixing PR 81635: use range info in split_constant_offset to see whether a conversion of a wrapping type can be split. The range info problem described in: https://gcc.gnu.org/ml/gcc-patches/2017-08/msg01002.html seems to have been fixed. The patch is part 1. There needs to be a follow-on patch to handle: for (unsigned int i = 0; i < n; i += 4) { ...[i + 2]... ...[i + 3]... which the old SCEV test handles, but which the range check doesn't. At the moment we record that the low two bits of "i" are clear, but we still end up with a maximum range of 0xffffffff rather than 0xfffffffc. 2018-01-31 Richard Sandiford <richard.sandif...@linaro.org> gcc/ PR tree-optimization/81635 * tree-data-ref.c (split_constant_offset_1): For types that wrap on overflow, try to use range info to prove that wrapping cannot occur. gcc/testsuite/ PR tree-optimization/81635 * gcc.dg/vect/bb-slp-pr81635-1.c: New test. * gcc.dg/vect/bb-slp-pr81635-2.c: Likewise. Added: trunk/gcc/testsuite/gcc.dg/vect/bb-slp-pr81635-1.c trunk/gcc/testsuite/gcc.dg/vect/bb-slp-pr81635-2.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-data-ref.c