re PR tree-optimization/92056 (ice in expr_object_size, at tree-object-si ze.c:675 with -O3)
PR tree-optimization/92056 * tree-ssa-strlen.c (determine_min_objsize): Call init_object_sizes before calling compute_builtin_object_size. * gcc.dg/tree-ssa/pr92056.c: New test. From-SVN: r277134
This commit is contained in:
parent
ac4c7868f1
commit
928a7c35ae
4 changed files with 49 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2019-10-18 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/92056
|
||||
* tree-ssa-strlen.c (determine_min_objsize): Call init_object_sizes
|
||||
before calling compute_builtin_object_size.
|
||||
|
||||
2019-10-17 Iain Sandoe <iain@sandoe.co.uk>
|
||||
|
||||
PR target/65342
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2019-10-18 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/92056
|
||||
* gcc.dg/tree-ssa/pr92056.c: New test.
|
||||
|
||||
2019-10-17 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* g++.old-deja/g++.other/decl9.C: Check locations too.
|
||||
|
|
36
gcc/testsuite/gcc.dg/tree-ssa/pr92056.c
Normal file
36
gcc/testsuite/gcc.dg/tree-ssa/pr92056.c
Normal file
|
@ -0,0 +1,36 @@
|
|||
/* PR tree-optimization/92056 */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -fdump-tree-optimized" } */
|
||||
/* { dg-final { scan-tree-dump-times "return 1;" 2 "optimized" } } */
|
||||
/* { dg-final { scan-tree-dump-not "strcmp \\(" "optimized" } } */
|
||||
|
||||
void bar (int, char *);
|
||||
|
||||
int
|
||||
foo (int x, char *y, const char *z)
|
||||
{
|
||||
char *a;
|
||||
__builtin_sprintf (y, z);
|
||||
if (x == 3)
|
||||
a = __builtin_malloc (5);
|
||||
else if (x == 7)
|
||||
a = __builtin_malloc (6);
|
||||
else
|
||||
a = __builtin_malloc (7);
|
||||
bar (x, a);
|
||||
return __builtin_strcmp (a, "abcdefg") != 0;
|
||||
}
|
||||
|
||||
int
|
||||
baz (int x)
|
||||
{
|
||||
char *a;
|
||||
if (x == 3)
|
||||
a = __builtin_malloc (5);
|
||||
else if (x == 7)
|
||||
a = __builtin_malloc (6);
|
||||
else
|
||||
a = __builtin_malloc (7);
|
||||
bar (x, a);
|
||||
return __builtin_strcmp (a, "abcdefg") != 0;
|
||||
}
|
|
@ -3462,6 +3462,8 @@ determine_min_objsize (tree dest)
|
|||
{
|
||||
unsigned HOST_WIDE_INT size = 0;
|
||||
|
||||
init_object_sizes ();
|
||||
|
||||
if (compute_builtin_object_size (dest, 2, &size))
|
||||
return size;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue