[Bug middle-end/79537] [5/6/7 Regression] ICE in gimplify_expr, at gimplify.c:12009
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 15 19:06:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79537
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
gimplify_expr has code to handle taking the address of a label:
11610 case LABEL_DECL:
11611 /* We get here when taking the address of a label. We mark
11612 the label as "forced"; meaning it can never be removed and
11613 it is a potential target for any computed goto. */
11614 FORCED_LABEL (*expr_p) = 1;
11615 ret = GS_ALL_DONE;
11616 break;
but we crash later on in the switch here:
11978 /* We aren't looking for a value, and we don't have a valid
11979 statement. If it doesn't have side-effects, throw it away. */
11980 if (!TREE_SIDE_EFFECTS (*expr_p))
11981 *expr_p = NULL;
11982 else if (!TREE_THIS_VOLATILE (*expr_p))
11983 {
11984 /* This is probably a _REF that contains something nested that
11985 has side effects. Recurse through the operands to find it.
*/
11986 enum tree_code code = TREE_CODE (*expr_p);
The problem is that the LABEL_DECL L is considered TREE_SIDE_EFFECTS, because
the definition of FORCED_LABEL is:
#define FORCED_LABEL(NODE) (LABEL_DECL_CHECK (NODE)->base.side_effects_flag)
More information about the Gcc-bugs
mailing list