From patchwork Tue Mar 15 03:44:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 597356 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qPL8f0vv9z9sds for ; Tue, 15 Mar 2016 14:44:33 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Qr3ofkTc; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:cc:message-id:date:mime-version:content-type; q= dns; s=default; b=EgGx+HJzYKdnV0006ZgICjaBpWVgcV/X7oigVLxMTG4oaT vLY65W8Czp8PFCJVRXlTLx4FDBBiJDJAMtKZn4VjuHqRi8n87bETZ9GJfp1R81Gs CGd0SVmz+eJD0y5I7c8s/E6boO7GcrsByavvpYKUKS9S5EHd0PPI5GPkbH8Hk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:cc:message-id:date:mime-version:content-type; s= default; bh=1muFFvLxvYvKdwSetlgLm9BC9PQ=; b=Qr3ofkTccetXgF1p6Gfo L+UP13903kmj9salhtjU7c1nFeSK/PiRmmm0JV6MBZ6JJY0yMavMXyMfYOh61d+/ s0wOoEy6/3ZQiROdl2V/I6aL0QMawNcW667bmueninQoOblT14fczWBZ/9BHSNY1 ZLYz+znh+om1A3MmvgK8oQ8= Received: (qmail 52367 invoked by alias); 15 Mar 2016 03:44:09 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 52349 invoked by uid 89); 15 Mar 2016 03:44:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*F:U*rth X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 15 Mar 2016 03:44:06 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 4CA7E7F6A8 for ; Tue, 15 Mar 2016 03:44:04 +0000 (UTC) Received: from bigtime.twiddle.net (ovpn-113-67.phx2.redhat.com [10.3.113.67]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2F3i1sw026990; Mon, 14 Mar 2016 23:44:01 -0400 To: gcc-patches@gcc.gnu.org From: Richard Henderson Subject: [PATCH] Fix 70199 Cc: Jeff Law Message-ID: <56E78500.1040309@redhat.com> Date: Mon, 14 Mar 2016 20:44:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 X-IsSubscribed: yes The problem here is that void* labels[] = { &&l0, &&l1, &&l2 }; gets gimplified to labels = *.LC0; but .LC0 is not in the set of local decls, so that when copy_forbidden is called during sra versioning we fail to forbid the copy. We could set a different flag, but I think it's easiest to just add the artificial decl to where it can be seen. Ok? r~ * gimplify.c (gimplify_init_constructor): Add the constant def decl to the function's local decls. diff --git a/gcc/gimplify.c b/gcc/gimplify.c index b331e41..884482e 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -4016,6 +4016,7 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, walk_tree (&ctor, force_labels_r, NULL, NULL); ctor = tree_output_constant_def (ctor); + add_local_decl (cfun, ctor); if (!useless_type_conversion_p (type, TREE_TYPE (ctor))) ctor = build1 (VIEW_CONVERT_EXPR, type, ctor); TREE_OPERAND (*expr_p, 1) = ctor;