aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2017-02-20 15:05:53 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2017-02-20 15:05:53 +0000
commit80480ceee903c0f55d23995b7ae0a58fee2e7f43 (patch)
tree1c2d5c31becd36af44dd4fd90a0c381b2c059b33 /gcc/gimplify.c
parentb93a9a15ee1975ab5aafad34748dec06a74a161d (diff)
downloadgcc-80480ceee903c0f55d23995b7ae0a58fee2e7f43.zip
gcc-80480ceee903c0f55d23995b7ae0a58fee2e7f43.tar.gz
gcc-80480ceee903c0f55d23995b7ae0a58fee2e7f43.tar.bz2
re PR middle-end/79537 (ICE in gimplify_expr, at gimplify.c:12009)
PR middle-end/79537 * gimplify.c (gimplify_expr): Handle unused *&&L;. * gcc.dg/comp-goto-4.c: New. From-SVN: r245604
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 1b9c8d2..820459c 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -11976,8 +11976,11 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
if (fallback == fb_none && *expr_p && !is_gimple_stmt (*expr_p))
{
/* We aren't looking for a value, and we don't have a valid
- statement. If it doesn't have side-effects, throw it away. */
- if (!TREE_SIDE_EFFECTS (*expr_p))
+ statement. If it doesn't have side-effects, throw it away.
+ We can also get here with code such as "*&&L;", where L is
+ a LABEL_DECL that is marked as FORCED_LABEL. */
+ if (TREE_CODE (*expr_p) == LABEL_DECL
+ || !TREE_SIDE_EFFECTS (*expr_p))
*expr_p = NULL;
else if (!TREE_THIS_VOLATILE (*expr_p))
{