[PATCH] Fix ICE with strlen optimization (PR tree-optimization/50604)

Jeff Law law@redhat.com
Tue Oct 4 19:32:00 GMT 2011


-----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-----



More information about the Gcc-patches mailing list