+2010-02-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/43150
+ * gimplify.c (gimplify_type_sizes): Clear DECL_IGNORED_P for VLA
+ bounds even for -O+.
+ * var-tracking.c (track_expr_p): If !need_rtl, don't mandate
+ expr needs to have DECL_NAME set.
+
2010-02-24 Nick Clifton <nickc@redhat.com>
* config/mep/mep.c: Include gimple.h.
/* These types may not have declarations, so handle them here. */
gimplify_type_sizes (TREE_TYPE (type), list_p);
gimplify_type_sizes (TYPE_DOMAIN (type), list_p);
- /* When not optimizing, ensure VLA bounds aren't removed. */
- if (!optimize
- && TYPE_DOMAIN (type)
+ /* Ensure VLA bounds aren't removed, for -O0 they should be variables
+ with assigned stack slots, for -O1+ -g they should be tracked
+ by VTA. */
+ if (TYPE_DOMAIN (type)
&& INTEGRAL_TYPE_P (TYPE_DOMAIN (type)))
{
t = TYPE_MIN_VALUE (TYPE_DOMAIN (type));
+2010-02-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/43150
+ * gcc.dg/guality/vla-1.c: New test.
+
2010-02-24 Tobias Burnus <burnus@net-b.de>
PR fortran/43042
--- /dev/null
+/* PR debug/43150 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+void __attribute__((noinline))
+bar (short *p)
+{
+ __builtin_memset (p, '\0', 17 * sizeof (*p));
+ asm volatile ("" : : "r" (p) : "memory");
+}
+
+int __attribute__((noinline))
+f1 (int i)
+{
+ char a[i + 1];
+ a[0] = 5; /* { dg-final { gdb-test 17 "i" "5" } } */
+ return a[0]; /* { dg-final { gdb-test 17 "sizeof (a)" "6" } } */
+}
+
+int __attribute__((noinline))
+f2 (int i)
+{
+ short a[i * 2 + 7]; /* { dg-final { gdb-test 24 "i" "5" } } */
+ bar (a); /* { dg-final { gdb-test 24 "sizeof (a)" "17 * sizeof (short)" } } */
+ return a[i + 4];
+}
+
+int
+main ()
+{
+ int i = 5;
+ asm volatile ("" : "=r" (i) : "0" (i));
+ f1 (i);
+ f2 (i);
+ return 0;
+}
return 0;
/* It also must have a name... */
- if (!DECL_NAME (expr))
+ if (!DECL_NAME (expr) && need_rtl)
return 0;
/* ... and a RTL assigned to it. */