backport: tree-object-size.c (pass_through_call): Do not handle BUILT_IN_STPNCPY_CHK which is not a pass through call.
Backported from mainline 2017-11-24 Jakub Jelinek <jakub@redhat.com> * tree-object-size.c (pass_through_call): Do not handle BUILT_IN_STPNCPY_CHK which is not a pass through call. * gcc.dg/builtin-object-size-18.c: New test. From-SVN: r255714
This commit is contained in:
parent
7c11fb2820
commit
5a8687cc52
@ -1,6 +1,11 @@
|
||||
2017-12-15 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
Backported from mainline
|
||||
2017-11-24 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* tree-object-size.c (pass_through_call): Do not handle
|
||||
BUILT_IN_STPNCPY_CHK which is not a pass through call.
|
||||
|
||||
2017-11-23 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR middle-end/82253
|
||||
|
@ -1,6 +1,10 @@
|
||||
2017-12-15 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
Backported from mainline
|
||||
2017-11-24 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* gcc.dg/builtin-object-size-18.c: New test.
|
||||
|
||||
2017-11-23 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR middle-end/82253
|
||||
|
15
gcc/testsuite/gcc.dg/builtin-object-size-18.c
Normal file
15
gcc/testsuite/gcc.dg/builtin-object-size-18.c
Normal file
@ -0,0 +1,15 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -fdump-tree-optimized" } */
|
||||
/* __stpncpy_chk could return buf up to buf + 64, so
|
||||
the minimum object size might be far smaller than 64. */
|
||||
/* { dg-final { scan-tree-dump-not "return 64;" "optimized" } } */
|
||||
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
|
||||
size_t
|
||||
foo (const char *p, size_t s, size_t t)
|
||||
{
|
||||
char buf[64];
|
||||
char *q = __builtin___stpncpy_chk (buf, p, s, t);
|
||||
return __builtin_object_size (q, 2);
|
||||
}
|
@ -481,7 +481,6 @@ pass_through_call (const gcall *call)
|
||||
case BUILT_IN_MEMSET_CHK:
|
||||
case BUILT_IN_STRCPY_CHK:
|
||||
case BUILT_IN_STRNCPY_CHK:
|
||||
case BUILT_IN_STPNCPY_CHK:
|
||||
case BUILT_IN_STRCAT_CHK:
|
||||
case BUILT_IN_STRNCAT_CHK:
|
||||
case BUILT_IN_ASSUME_ALIGNED:
|
||||
|
Loading…
Reference in New Issue
Block a user