r246236 - in /branches/ARM/sve-branch/gcc: test...
rsandifo@gcc.gnu.org
rsandifo@gcc.gnu.org
Fri Mar 17 17:25:00 GMT 2017
Author: rsandifo
Date: Fri Mar 17 17:25:30 2017
New Revision: 246236
URL: https://gcc.gnu.org/viewcvs?rev=246236&root=gcc&view=rev
Log:
Make tree-ssa-strlen.c handle partial unterminated strings
tree-ssa-strlen.c looks for cases in which a string is built
up using operations like:
memcpy (a, "foo", 4);
memcpy (a + 3, "bar", 4);
int x = strlen (a);
As a side-effect, it optimises the non-final memcpys so that
they don't include the nul terminator.
However, after removing some "& ~0x1"s from tree-ssa-dse.c,
the DSE patch does this optimisation itself (because it can
tell that later memcpys overwrite the terminators). The strlen
pass wasn't able to handle these pre-optimised calls in the same
way as the unoptimised ones.
This patch adds support for tracking unterminated strings.
Added:
branches/ARM/sve-branch/gcc/testsuite/gcc.dg/strlenopt-31.c
Modified:
branches/ARM/sve-branch/gcc/tree-ssa-strlen.c
More information about the Gcc-cvs
mailing list