@@ -6984,7 +6984,8 @@ gimplify_addr_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
*expr_p = build_fold_addr_expr (op0);
/* Make sure TREE_CONSTANT and TREE_SIDE_EFFECTS are set properly. */
- recompute_tree_invariant_for_addr_expr (*expr_p);
+ if (TREE_CODE (*expr_p) == ADDR_EXPR)
+ recompute_tree_invariant_for_addr_expr (*expr_p);
/* If we re-built the ADDR_EXPR add a conversion to the original type
if required. */
new file mode 100644
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct obj {
+ int n;
+ int l;
+};
+int main()
+{
+ (struct obj *)((char *)(__SIZE_TYPE__)({ 0; }) - (char *)&((struct obj *)0)->l);
+}