From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89641 invoked by alias); 30 Oct 2017 17:04:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 89625 invoked by uid 89); 30 Oct 2017 17:04:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=ta, tb, s.a, his 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 ESMTP; Mon, 30 Oct 2017 17:04:02 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F9DF13AAB for ; Mon, 30 Oct 2017 17:04:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0F9DF13AAB Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub@redhat.com Received: from tucnak.zalov.cz (ovpn-116-247.ams2.redhat.com [10.36.116.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ACA8C5C550 for ; Mon, 30 Oct 2017 17:04:00 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v9UH3wpk008301 for ; Mon, 30 Oct 2017 18:03:58 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v9UH3vsW008300 for gcc-patches@gcc.gnu.org; Mon, 30 Oct 2017 18:03:57 +0100 Date: Mon, 30 Oct 2017 17:04:00 -0000 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Unbreak big-endian bootstrap (PR middle-end/22141) Message-ID: <20171030170357.GQ14653@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg02225.txt.bz2 Hi! Apparently I broke bootstrap or testing on big-endian targets, I'm sorry for screwing up testing and not testing on any big-endian. I've committed the following patch which fixes miscompilation on the following short testcase: struct S { char a, b, c, d; } s; struct T { int a : 2, b : 5, c : 17, d : 8; } t, t2; __attribute__((noipa)) void foo (void) { s.a = 1; s.b = 2; s.c = 3; s.d = 4; } __attribute__((noipa)) void bar (void) { t.a = 1; t.b = 2; t.c = 3; t.d = 4; } __attribute__((noipa)) void baz (void) { t.a = -2; t.c = 7; t.d = 8; } int main () { foo (); if (s.a != 1 || s.b != 2 || s.c != 3 || s.d != 4) __builtin_abort (); bar (); if (t.a != 1 || t.b != 2 || t.c != 3 || t.d != 4) __builtin_abort (); baz (); if (t.a != -2 || t.b != 2 || t.c != 7 || t.d != 8) __builtin_abort (); __builtin_memset (&t, 0, sizeof (t)); baz (); if (t.a != -2 || t.b != 0 || t.c != 7 || t.d != 8) __builtin_abort (); __builtin_memset (&t, -1, sizeof (t)); baz (); if (t.a != -2 || t.b != -1 || t.c != 7 || t.d != 8) __builtin_abort (); return 0; } as obvious to unbreak bootstrap. David said his AIX bootstrap is past the bootstrap failure point now with this change. 2017-10-30 Jakub Jelinek PR middle-end/22141 * gimple-ssa-store-merging.c (merged_store_group::apply_stores): Fix arguments to clear_bit_region_be. --- gcc/gimple-ssa-store-merging.c.jj 2017-10-30 12:03:56.601219516 +0100 +++ gcc/gimple-ssa-store-merging.c 2017-10-30 17:03:55.713149323 +0100 @@ -701,7 +701,9 @@ merged_store_group::apply_stores () return false; unsigned char *m = mask + (pos_in_buffer / BITS_PER_UNIT); if (BYTES_BIG_ENDIAN) - clear_bit_region_be (m, pos_in_buffer % BITS_PER_UNIT, info->bitsize); + clear_bit_region_be (m, (BITS_PER_UNIT - 1 + - (pos_in_buffer % BITS_PER_UNIT)), + info->bitsize); else clear_bit_region (m, pos_in_buffer % BITS_PER_UNIT, info->bitsize); } Jakub