+2010-01-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/42645
+ * tree-inline.c (processing_debug_stmt): Move earlier. Make static.
+ (remap_ssa_name): If processing_debug_stmt and name wasn't found in
+ decl_map, set processing_debug_stmt to -1 and return name without
+ any remapping.
+
2010-01-11 Dave Korn <dave.korn.cygwin@gmail.com>
* doc/install.texi (Specific#x-x-cygwin): Document minimum required
--- /dev/null
+// PR tree-optimization/42645
+// { dg-do compile }
+// { dg-options "-fcompare-debug -O1" }
+
+extern void foo ();
+
+struct S
+{
+ struct T
+ {
+ int t1;
+ char t2[4];
+ T *t3;
+ } t;
+ int m1 () const { return t.t3[0].t1; }
+ char *m2 () { foo (); }
+ void m3 (int x) { char *m = m2 (); if (m1 () > 0 && x > 0); }
+ void m4 () { if (m1 () > 0) for (int i = 0; i < 4; i++) t.t2[i] = 0; }
+};
+
+void
+f (S *a)
+{
+ a->m3 (0);
+ a->m4 ();
+}
/* Tree inlining.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com>
*pointer_map_insert (id->debug_map, key) = value;
}
+/* If nonzero, we're remapping the contents of inlined debug
+ statements. If negative, an error has occurred, such as a
+ reference to a variable that isn't available in the inlined
+ context. */
+static int processing_debug_stmt = 0;
+
/* Construct new SSA name for old NAME. ID is the inline context. */
static tree
if (n)
return unshare_expr (*n);
+ if (processing_debug_stmt)
+ {
+ processing_debug_stmt = -1;
+ return name;
+ }
+
/* Do not set DEF_STMT yet as statement is not copied yet. We do that
in copy_bb. */
new_tree = remap_decl (SSA_NAME_VAR (name), id);
return new_tree;
}
-/* If nonzero, we're remapping the contents of inlined debug
- statements. If negative, an error has occurred, such as a
- reference to a variable that isn't available in the inlined
- context. */
-int processing_debug_stmt = 0;
-
/* Remap DECL during the copying of the BLOCK tree for the function. */
tree