aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSteven Bosscher <stevenb@suse.de>2005-02-01 22:50:12 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2005-02-01 22:50:12 +0000
commit7a442a1de62d1534517c37edba3cd2be68461b02 (patch)
treeec7e286bc00ac8169243deab25f4be197318833c /gcc
parent475b6e22db0635ca0dfd0b9cac640ce9fd11690a (diff)
downloadgcc-7a442a1de62d1534517c37edba3cd2be68461b02.zip
gcc-7a442a1de62d1534517c37edba3cd2be68461b02.tar.gz
gcc-7a442a1de62d1534517c37edba3cd2be68461b02.tar.bz2
re PR tree-optimization/19217 (ICE: verify_stmts failed: address taken, but ADDRESSABLE bit not set)
PR tree-optimization/19217 * tree-cfg.c (verify_expr): Use the data field to see if TP was seen inside a PHI node. Do not do the ADDR_EXPR check if it was. (verify_stmts): Pass (void*)1 as data to verify_expr to signal that it is walking a PHI node. From-SVN: r94570
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/tree-cfg.c16
2 files changed, 22 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7354034..ac04aeb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2005-02-01 Steven Bosscher <stevenb@suse.de>
+
+ PR tree-optimization/19217
+ * tree-cfg.c (verify_expr): Use the data field to see if TP was
+ seen inside a PHI node. Do not do the ADDR_EXPR check if it was.
+ (verify_stmts): Pass (void*)1 as data to verify_expr to signal
+ that it is walking a PHI node.
+
2005-02-01 Joseph S. Myers <joseph@codesourcery.com>
* doc/extend.texi (Nested Functions): Update.
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 4df5855..ba4fbdc 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3231,12 +3231,14 @@ has_label_p (basic_block bb, tree label)
/* Callback for walk_tree, check that all elements with address taken are
- properly noticed as such. */
+ properly noticed as such. The DATA is an int* that is 1 if TP was seen
+ inside a PHI node. */
static tree
verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
{
tree t = *tp, x;
+ bool in_phi = (data != NULL);
if (TYPE_P (t))
*walk_subtrees = 0;
@@ -3270,6 +3272,16 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
break;
case ADDR_EXPR:
+ /* ??? tree-ssa-alias.c may have overlooked dead PHI nodes, missing
+ dead PHIs that take the address of something. But if the PHI
+ result is dead, the fact that it takes the address of anything
+ is irrelevant. Because we can not tell from here if a PHI result
+ is dead, we just skip this check for PHIs altogether. This means
+ we may be missing "valid" checks, but what can you do?
+ This was PR19217. */
+ if (in_phi)
+ break;
+
/* Skip any references (they will be checked when we recurse down the
tree) and ensure that any variable used as a prefix is marked
addressable. */
@@ -3546,7 +3558,7 @@ verify_stmts (void)
err |= true;
}
- addr = walk_tree (&t, verify_expr, NULL, NULL);
+ addr = walk_tree (&t, verify_expr, (void *) 1, NULL);
if (addr)
{
debug_generic_stmt (addr);