This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ICE with strlen optimization (PR tree-optimization/50604)
- From: Jeff Law <law at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 04 Oct 2011 13:16:03 -0600
- Subject: Re: [PATCH] Fix ICE with strlen optimization (PR tree-optimization/50604)
- References: <20111004110038.GK19412@tyan-ft48-01.lab.bos.redhat.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 10/04/11 05:00, Jakub Jelinek wrote:
> Hi!
>
> The following testcase ICEs on the trunk, as strlen optimization
> was assuming memcpy arguments will have expected type
> (size_type_node), but they had ssizetype instead. The following
> patch fixes it both in the builtins.c folders that create memcpy
> and also in the strlen pass to no longer assume that.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?
>
> 2011-10-04 Jakub Jelinek <jakub@redhat.com>
>
> PR tree-optimization/50604 * builtins.c (fold_builtin_strcpy,
> fold_builtin_stpcpy, fold_builtin_strncpy,
> fold_builtin_stxcpy_chk): Ensure last argument to memcpy has
> size_type_node type instead of ssizetype. * tree-ssa-strlen.c
> (handle_builtin_memcpy): Use size_type_node instead of TREE_TYPE
> (len) as type for newlen.
>
> * gcc.dg/pr50604.c: New test.
OK.
jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJOi1tzAAoJEBRtltQi2kC7r3EH/2gy6Wj3PZKjBPux97XXTAKn
Iz/Bn/8J4yCbYseS/Obbg7BE3qrHMePdq53Gbq5bOOJAifHl5l3u7WaOBVBBtAxP
CQFKaWBn0U7++Wsuyyd5s7z+/bpiEJBcZNQzxwMUrZ+ue3w+qlipYL7Qpepl7+WB
BTnctEfr9RPJ3OMBER/6DOXchQkc+YdG3IvtjKWXTfexIQyQi0WEEDvZe4EQQLZD
jN1LQZKHR4nP0exgTUOdxemRvg1Bb5l8dH6Y9gfmMWlxpsKDJBNq3eXRLurTOW1+
jhaY3AD8NOkI+plpKhpJuzBiBil8N5yODrxme+h/q03/dYYxwh2ApIEyGIQlylM=
=fOz8
-----END PGP SIGNATURE-----