Commit f05b3724 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/91945 (ICE: tree check: expected integer_cst, have…

re PR tree-optimization/91945 (ICE: tree check: expected integer_cst, have var_decl in get_len, at tree.h:5837 since r274997)

	PR tree-optimization/91945
	* builtins.c (compute_objsize): For ARRAY_REF, only multiply off
	by tpsize if it is both non-NULL and INTEGER_CST, otherwise punt.
	Formatting fix.

	* gfortran.dg/pr91945.f90: New test.

From-SVN: r277820
parent 81012684
2019-11-05 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/91945
* builtins.c (compute_objsize): For ARRAY_REF, only multiply off
by tpsize if it is both non-NULL and INTEGER_CST, otherwise punt.
Formatting fix.
2019-11-05 Aldy Hernandez <aldyh@redhat.com>
* range-op.cc (wi_set_zero_nonzero_bits): Remove static qualifier.
......@@ -3626,7 +3626,7 @@ compute_objsize (tree dest, int ostype, tree *pdecl /* = NULL */)
}
}
else if (TREE_CODE (off) == SSA_NAME
&& INTEGRAL_TYPE_P (TREE_TYPE (off)))
&& INTEGRAL_TYPE_P (TREE_TYPE (off)))
{
wide_int min, max;
enum value_range_kind rng = get_range_info (off, &min, &max);
......@@ -3680,7 +3680,8 @@ compute_objsize (tree dest, int ostype, tree *pdecl /* = NULL */)
if (TREE_CODE (dest) == ARRAY_REF)
{
tree eltype = TREE_TYPE (dest);
if (tree tpsize = TYPE_SIZE_UNIT (eltype))
tree tpsize = TYPE_SIZE_UNIT (eltype);
if (tpsize && TREE_CODE (tpsize) == INTEGER_CST)
off = fold_build2 (MULT_EXPR, size_type_node, off, tpsize);
else
return NULL_TREE;
......
2019-11-05 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/91945
* gfortran.dg/pr91945.f90: New test.
PR c++/92343
* g++.dg/cpp2a/attr-likely6.C: New test.
......
! PR tree-optimization/91945
! { dg-do compile }
! { dg-options "-O3 -fstack-arrays -fno-guess-branch-probability" }
include 'result_in_spec_1.f90'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment