Fix ICE when __builtin_calloc has no LHS (PR tree-optimization/91014).
2019-06-27 Martin Liska <mliska@suse.cz> PR tree-optimization/91014 * tree-ssa-dse.c (initialize_ao_ref_for_dse): Bail out when LHS is NULL_TREE. 2019-06-27 Martin Liska <mliska@suse.cz> PR tree-optimization/91014 * gcc.target/s390/pr91014.c: New test. From-SVN: r272738
This commit is contained in:
parent
fecd7a1ab4
commit
4c4be718fb
4 changed files with 22 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2019-06-27 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR tree-optimization/91014
|
||||
* tree-ssa-dse.c (initialize_ao_ref_for_dse): Bail out
|
||||
when LHS is NULL_TREE.
|
||||
|
||||
2019-06-27 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* symbol-summary.h (traverse): Pass
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2019-06-27 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR tree-optimization/91014
|
||||
* gcc.target/s390/pr91014.c: New test.
|
||||
|
||||
2019-06-27 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR testsuite/91004
|
||||
|
|
8
gcc/testsuite/gcc.target/s390/pr91014.c
Normal file
8
gcc/testsuite/gcc.target/s390/pr91014.c
Normal file
|
@ -0,0 +1,8 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O" } */
|
||||
/* { dg-require-effective-target alloca } */
|
||||
|
||||
void foo(void)
|
||||
{
|
||||
__builtin_calloc (1, 1); /* { dg-warning "ignoring return value of '__builtin_calloc' declared with attribute 'warn_unused_result'" } */
|
||||
}
|
|
@ -129,10 +129,11 @@ initialize_ao_ref_for_dse (gimple *stmt, ao_ref *write)
|
|||
{
|
||||
tree nelem = gimple_call_arg (stmt, 0);
|
||||
tree selem = gimple_call_arg (stmt, 1);
|
||||
tree lhs;
|
||||
if (TREE_CODE (nelem) == INTEGER_CST
|
||||
&& TREE_CODE (selem) == INTEGER_CST)
|
||||
&& TREE_CODE (selem) == INTEGER_CST
|
||||
&& (lhs = gimple_call_lhs (stmt)) != NULL_TREE)
|
||||
{
|
||||
tree lhs = gimple_call_lhs (stmt);
|
||||
tree size = fold_build2 (MULT_EXPR, TREE_TYPE (nelem),
|
||||
nelem, selem);
|
||||
ao_ref_init_from_ptr_and_size (write, lhs, size);
|
||||
|
|
Loading…
Add table
Reference in a new issue