diff options
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 433ec60..39548e2 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -13225,35 +13225,36 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) } /* switch (code) */ } -/* Callback for walk_tree, looking for LABEL_EXPR. - Returns tree TP if it is LABEL_EXPR. Otherwise it returns NULL_TREE. - Do not check the sub-tree of GOTO_EXPR. */ +/* Callback for walk_tree, looking for LABEL_EXPR. Return *TP if it is + a LABEL_EXPR; otherwise return NULL_TREE. Do not check the subtrees + of GOTO_EXPR. */ static tree -contains_label_1 (tree *tp, - int *walk_subtrees, - void *data ATTRIBUTE_UNUSED) +contains_label_1 (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) { switch (TREE_CODE (*tp)) { case LABEL_EXPR: return *tp; + case GOTO_EXPR: *walk_subtrees = 0; - /* no break */ + + /* ... fall through ... */ + default: return NULL_TREE; } } -/* Checks whether the sub-tree ST contains a label LABEL_EXPR which is - accessible from outside the sub-tree. Returns NULL_TREE if no - addressable label is found. */ +/* Return whether the sub-tree ST contains a label which is accessible from + outside the sub-tree. */ static bool contains_label_p (tree st) { - return (walk_tree (&st, contains_label_1 , NULL, NULL) != NULL_TREE); + return + (walk_tree_without_duplicates (&st, contains_label_1 , NULL) != NULL_TREE); } /* Fold a ternary expression of code CODE and type TYPE with operands |