re PR tree-optimization/92891 (ice in decompose, at wide-int.h:984)
PR tree-optimization/92891 * builtins.c (gimple_call_alloc_size): Convert size to sizetype before returning it. * gcc.c-torture/compile/pr92891.c: New test. From-SVN: r279205
This commit is contained in:
parent
7436a1c675
commit
a6ae300f9a
@ -1,3 +1,9 @@
|
||||
2019-12-10 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/92891
|
||||
* builtins.c (gimple_call_alloc_size): Convert size to sizetype
|
||||
before returning it.
|
||||
|
||||
2019-12-10 Vladimir Makarov <vmakarov@redhat.com>
|
||||
|
||||
PR rtl-optimization/92796
|
||||
|
@ -3755,7 +3755,7 @@ gimple_call_alloc_size (gimple *stmt)
|
||||
return NULL_TREE;
|
||||
|
||||
if (argidx2 > nargs && TREE_CODE (size) == INTEGER_CST)
|
||||
return size;
|
||||
return fold_convert (sizetype, size);
|
||||
|
||||
/* To handle ranges do the math in wide_int and return the product
|
||||
of the upper bounds as a constant. Ignore anti-ranges. */
|
||||
|
@ -1,3 +1,8 @@
|
||||
2019-12-10 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/92891
|
||||
* gcc.c-torture/compile/pr92891.c: New test.
|
||||
|
||||
2019-12-10 Vladimir Makarov <vmakarov@redhat.com>
|
||||
|
||||
PR rtl-optimization/92796
|
||||
|
16
gcc/testsuite/gcc.c-torture/compile/pr92891.c
Normal file
16
gcc/testsuite/gcc.c-torture/compile/pr92891.c
Normal file
@ -0,0 +1,16 @@
|
||||
/* PR tree-optimization/92891 */
|
||||
|
||||
int a, b;
|
||||
char *foo (int) __attribute__((alloc_size(1)));
|
||||
|
||||
void
|
||||
bar (void)
|
||||
{
|
||||
char *e = foo (2);
|
||||
while (a)
|
||||
{
|
||||
if (b <= 0)
|
||||
continue;
|
||||
e[b] = 0;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user