From patchwork Tue Oct 8 08:19:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 281353 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 033C72C009E for ; Tue, 8 Oct 2013 19:20:33 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=SWBLKih/Lkf9eLu8 9EzkK8vbtoIygObYB95wJzPC9x+nHVTkvCQJnMJ3S1Cl2D4trTIq1cOgTQ97O2Ap HEJthp9iunM0GSpZVKIj2Ty8ceORxCtikG6iSaOtmamk9eIoQinBHjICnkrPxOo2 PkJid7/p23n5haWglRw5QQMxUfI= 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:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=6Yy6K6R0tmgxgQqb/VIZCH pGq4I=; b=aTxeKZpf7ihdIHr4NlT4jUkOwbbGnEn8rB3/MRjCXxih2nkFAuVKap 6CftVIEzxHxGx8dLD9wvvNST7/AzH5B0VKZRYAA7Mh4rDsfjQl1cIMd/Q3e242i7 1Tmxt6ccBLGLHuJ+SewkGQLxxWfDXNTEWlrsczx61IzI5p6nLilF0= Received: (qmail 10961 invoked by alias); 8 Oct 2013 08:20:26 -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 10932 invoked by uid 89); 8 Oct 2013 08:20:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 08 Oct 2013 08:20:24 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id EB8FE2684328 for ; Tue, 8 Oct 2013 10:20:21 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GotrSG1Q2C_s for ; Tue, 8 Oct 2013 10:20:21 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id CFB7F26842E1 for ; Tue, 8 Oct 2013 10:20:21 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] Fix PR middle-end/58570 Date: Tue, 08 Oct 2013 10:19:42 +0200 Message-ID: <18178507.ChivVPE93z@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.29-desktop; KDE/4.7.2; x86_64; ; ) MIME-Version: 1.0 Hi, this is a regression on the mainline introduced by my tree-ssa-alias.c change: 2013-04-17 Eric Botcazou * tree-ssa-alias.c (nonoverlapping_component_refs_of_decl_p): New. (decl_refs_may_alias_p): Add REF1 and REF2 parameters. Use nonoverlapping_component_refs_of_decl_p to disambiguate component references. (refs_may_alias_p_1): Adjust call to decl_refs_may_alias_p. * tree-streamer.c (record_common_node): Adjust reference in comment. Unlike its model nonoverlapping_component_refs_p from alias.c, the predicate nonoverlapping_component_refs_of_decl_p considers that different fields in the same structure cannot overlap. While that's true in GIMPLE, that's false in RTL for bitfields and tree-ssa-alias.c is also queried from RTL nowadays... Therefore the attached patch just copies the missing bits from the former to the latter. Tested on x86_64-suse-linux, OK for the mainline? 2013-10-08 Eric Botcazou PR middle-end/58570 * tree-ssa-alias.c (nonoverlapping_component_refs_of_decl_p): Return false if both components are bitfields. 2013-10-08 Eric Botcazou * gcc.c-torture/execute/pr58570.c: New test. Index: tree-ssa-alias.c =================================================================== --- tree-ssa-alias.c (revision 203241) +++ tree-ssa-alias.c (working copy) @@ -803,12 +803,13 @@ nonoverlapping_component_refs_of_decl_p if (type1 != type2 || TREE_CODE (type1) != RECORD_TYPE) goto may_overlap; - /* Different fields of the same record type cannot overlap. */ + /* Different fields of the same record type cannot overlap, unless they + are both bitfields and we are at the RTL level. */ if (field1 != field2) { component_refs1.release (); component_refs2.release (); - return true; + return !(DECL_BIT_FIELD (field1) && DECL_BIT_FIELD (field2)); } }