From patchwork Thu Apr 16 07:01:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1271537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=E8neJX1j; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 492qsd2Dg8z9sP7 for ; Thu, 16 Apr 2020 17:02:11 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F39E4384A02E; Thu, 16 Apr 2020 07:02:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F39E4384A02E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587020528; bh=LTeOJ7mODYY+XGHnvYIaICh6kNoblCEjgm4LxqH/xDU=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=E8neJX1jyXMvIDm09s05BwLPm2+UF2/LGqNCVa4bgNE9b2khoHfIHI/aEQ52izrh5 lxt8mwYdH6h0jO4dJGYHTX6aeMc1Tj6KQxLGldwVFhyPG/I9E2u/iZl5UyTWIoykpk mkZk4a0FN4THkUVTMGwDTdFYLNcz0n9k3g5/FX2c= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by sourceware.org (Postfix) with ESMTP id A2E75385DC1E for ; Thu, 16 Apr 2020 07:02:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A2E75385DC1E Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-489-qrdu2BZ1NeKHr15FBflEwg-1; Thu, 16 Apr 2020 03:02:01 -0400 X-MC-Unique: qrdu2BZ1NeKHr15FBflEwg-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CD0F18C8C03; Thu, 16 Apr 2020 07:02:00 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-104.ams2.redhat.com [10.36.112.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A616F5C1C5; Thu, 16 Apr 2020 07:01:59 +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 03G71vV4020354; Thu, 16 Apr 2020 09:01:57 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 03G71vjV020353; Thu, 16 Apr 2020 09:01:57 +0200 Date: Thu, 16 Apr 2020 09:01:57 +0200 To: Richard Biener , Jeff Law Subject: [PATCH] bootstrap: Fix building with GCC 4.2 [PR89494] Message-ID: <20200416070157.GF2424@tucnak> MIME-Version: 1.0 User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-17.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi! GCC 4.2 (but I think not the latest tip of GCC 4.2 branch) has broken value initialization, see PR33916. The following patch provides a workaround for that. Tested with GCC 4.2 on a reduced testcase I've distilled from the assign_param_data_one class which has been miscompiled the same, and normally bootstrapped/regtested on x86_64-linux and i686-linux with a recentish system GCC. Ok for trunk? 2020-04-16 Jakub Jelinek PR bootstrap/89494 * function.c (assign_parm_find_data_types): Add workaround for BROKEN_VALUE_INITIALIZATION compilers. Jakub --- gcc/function.c.jj 2020-01-12 11:54:36.606410497 +0100 +++ gcc/function.c 2020-04-15 14:15:29.269495427 +0200 @@ -2414,7 +2414,15 @@ assign_parm_find_data_types (struct assi { int unsignedp; +#ifndef BROKEN_VALUE_INITIALIZATION *data = assign_parm_data_one (); +#else + /* Old versions of GCC used to miscompile the above by only initializing + the members with explicit constructors and copying garbage + to the other members. */ + assign_parm_data_one zero_data = {}; + *data = zero_data; +#endif /* NAMED_ARG is a misnomer. We really mean 'non-variadic'. */ if (!cfun->stdarg)