From afc610dba10fd532e83da10e19c5e0c5d7bcc34d Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Tue, 10 May 2016 15:56:27 +0000 Subject: re PR tree-optimization/70876 (ICE in chkp_find_bounds: Unexpected tree code with_size_expr) gcc/ PR tree-optimization/70786 * tree-chkp.c (chkp_find_bounds_1): Support WITH_SIZE_EXPR. * gcc/calls.c (initialize_argument_information): Bind bounds with corresponding args passed by reference. gcc/testsuite/ PR tree-optimization/70786 * gcc.target/i386/pr70876.c: New test. From-SVN: r236086 --- gcc/calls.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gcc/calls.c') diff --git a/gcc/calls.c b/gcc/calls.c index 6415e08..6cc1fc7 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1188,6 +1188,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, j--; } } + argpos = 0; FOR_EACH_CALL_EXPR_ARG (arg, iter, exp) { tree argtype = TREE_TYPE (arg); @@ -1206,6 +1207,14 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, chkp_find_bound_slots (argtype, slots); } } + else if (CALL_WITH_BOUNDS_P (exp) + && pass_by_reference (NULL, TYPE_MODE (argtype), argtype, + argpos < n_named_args)) + { + if (slots) + BITMAP_FREE (slots); + ptr_arg = j; + } else if (POINTER_BOUNDS_TYPE_P (argtype)) { /* We expect bounds in instrumented calls only. @@ -1249,6 +1258,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, else args[j].tree_value = arg; j--; + argpos++; } if (slots) -- cgit v1.1