+2018-07-28 Tom de Vries <tdevries@suse.de>
+
+ * eval.c (evaluate_subexp_for_sizeof): Interpret size of dynamic type
+ with undefined upper bound as <optimized out>.
+
2018-07-27 Sergio Durigan Junior <sergiodj@redhat.com>
* gcore.in: Rename variable "name" to "prefix". Expand
{
val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL);
type = value_type (val);
+ if (TYPE_HIGH_BOUND_UNDEFINED (TYPE_INDEX_TYPE (type)))
+ return allocate_optimized_out_value (size_type);
}
else
(*pos) += 4;
+2018-07-28 Tom de Vries <tdevries@suse.de>
+
+ * gdb.base/vla-optimized-out-o3-strict.exp: New file.
+
2018-07-26 Tom de Vries <tdevries@suse.de>
* gdb.base/vla-optimized-out.c: Add comment about origin of test-case.
--- /dev/null
+# Copyright 2018 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check whether we can determine the size of an optimized-out vla.
+
+standard_testfile
+
+if { [prepare_for_testing "failed to prepare" $testfile vla-optimized-out.c \
+ {debug optimize=-O3 additional_flags=-gstrict-dwarf}] } {
+ return -1
+}
+
+proc vla_optimized_out { } {
+ if ![runto f1] {
+ fail "can't run to f1"
+ return
+ }
+
+ gdb_test "p a" \
+ { = <optimized out>} \
+ "printed optimized out vla"
+
+ gdb_test "p sizeof (a)" \
+ { = <optimized out>} \
+ "printed optimized out size of optimized out vla"
+}
+
+vla_optimized_out