Commit 082ab5ff by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/42645 ("-fcompare-debug failure" at -O1)

	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.

	* g++.dg/other/pr42645-1.C: New test.
	* g++.dg/other/pr42645-2.C: New test.

From-SVN: r155830
parent b1a54dd0
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
......
2010-01-12 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/42645
* g++.dg/other/pr42645-1.C: New test.
* g++.dg/other/pr42645-2.C: New test.
2010-01-11 Janis Johnson <janis187@us.ibm.com>
PR target/42416
......
// 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 ();
}
// PR tree-optimization/42645
// { dg-do compile }
// { dg-options "-fcompare-debug -O1" }
struct C
{
bool b;
C ();
};
static inline C *foo () {}
extern void f4 ();
static inline int
f3 ()
{
f4 ();
}
static inline void
f2 (bool b)
{
int tmp = f3 ();
if (C ().b && b)
C ();
}
void
f1 ()
{
C *c = foo ();
f2 (c->b);
}
/* 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>
......@@ -171,6 +171,12 @@ insert_debug_decl_map (copy_body_data *id, tree key, tree value)
*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
......@@ -185,6 +191,12 @@ remap_ssa_name (tree name, copy_body_data *id)
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);
......@@ -244,12 +256,6 @@ remap_ssa_name (tree name, copy_body_data *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
......
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