re PR middle-end/78750 (ICE in get_range_info, at tree-ssanames.c:375)

PR middle-end/78750
	* builtins.c (check_sizes): Use POINTER_TYPE_P.

	* g++.dg/torture/pr78750.C: New.

From-SVN: r243498
This commit is contained in:
Marek Polacek 2016-12-09 19:05:28 +00:00
parent c915eee640
commit 59ab1319cb
2 changed files with 11 additions and 1 deletions

View File

@ -3091,7 +3091,7 @@ check_sizes (int opt, tree exp, tree size, tree maxlen, tree str, tree objsize)
{
/* STR is normally a pointer to string but as a special case
it can be an integer denoting the length of a string. */
if (TREE_CODE (TREE_TYPE (str)) == POINTER_TYPE)
if (POINTER_TYPE_P (TREE_TYPE (str)))
{
/* Try to determine the range of lengths the source string
refers to. If it can be determined add one to it for

View File

@ -0,0 +1,10 @@
// PR middle-end/78750
// { dg-do compile }
extern "C" char *strcpy (char *, const char *);
void
fn (char *p, char &as)
{
strcpy (p, &as);
}