@@ -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))
{
@@ -0,0 +1,21 @@
+/* PR middle-end/79537 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-require-effective-target indirect_jumps } */
+/* { dg-require-effective-target label_values } */
+
+void
+f (void)
+{
+L:
+ *&&L;
+}
+
+void
+f2 (void)
+{
+ void *p;
+L:
+ p = &&L;
+ *p; /* { dg-warning "dereferencing 'void \\*' pointer" } */
+}