From patchwork Wed Sep 27 04:43:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 145153 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2382225vqu; Tue, 26 Sep 2023 21:44:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGChzCvpEvEOT494RkSE1nbQ3n/HKZhPl9ST+ySc6s376ZWJMe/iHT3ZAPMNcIR70PIKIqj X-Received: by 2002:a19:645e:0:b0:4f8:77db:1d9e with SMTP id b30-20020a19645e000000b004f877db1d9emr581653lfj.12.1695789842279; Tue, 26 Sep 2023 21:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695789842; cv=none; d=google.com; s=arc-20160816; b=IXpXDcQySjQ9D65zN58nVfgZ/Js+ECItK/5na5oPHNNHoFlDvulTh8qhSZ39vVAtNX UM2jwiQyn8cIzXj4WECZ1paWTFEGRkwFhsSkyCwRyR9kA8FoRu1fQ73mCFpwCeoOl8PO 5Bb7b11sMMv0Gr0gZ/6aOudgUVzQeRo0OsHYX5sin2mvt34dLkL4zrlzGhM96qpAFZ1v GYlSaw95Mqinu/bgDU5FYou/TXadcVRtwpRZQ8gMfDpI0rZ9b34RB+E+pcoKXcoT+5qI NrVNsLvoixNATy0rF3IOSt89Iyg8CFADegRYCZbUk54JQpo84LO6HVmkpUIp7Se0L5YR GGHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :dmarc-filter:delivered-to; bh=PV4Rc80kmzR/IaOjVkECmL/sArRDY+FDtNa2LQz1Q3M=; fh=FCjeRajqaQYHMkQtfIia8KT5yBac53mYOLLyJhYG/AY=; b=N2Ps4u7khqzWNbIwg3YBRZKWsvC1KiPSAHiASlnqmZVbaPBjVjo/XXWS5gIk2ukSr7 d0gds60OWDpRqvP30BLgC4k2CJlhrrH1859U8ZyNSlBepWDorxh6P+2pE+gta2yolbQV JADORY6wp864c9BlRQSp4hoTRNKOzYV5BGO43RX13XPmZ36AmfOMltX3x17LhcIIOXpz 3oL1e7AZ+N7oFO7bLwRYswPFa0SscG9rZLrLxH6s8ET8Q0YaOlzs0Su1T6uvZb8vDGBe cYjdYBWbK29lyjYq2AW5g/YEw5XVm88+/CCKoJQNBhwyLYTzSewnVOEiVw35Ci/K/A6r 25eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BxRENSLx; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id if16-20020a0564025d9000b00533ce7c91cdsi7629099edb.493.2023.09.26.21.44.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 21:44:02 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BxRENSLx; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2CF20385CCA8 for ; Wed, 27 Sep 2023 04:43:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 2BC2E3858C74 for ; Wed, 27 Sep 2023 04:43:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2BC2E3858C74 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695789812; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=PV4Rc80kmzR/IaOjVkECmL/sArRDY+FDtNa2LQz1Q3M=; b=BxRENSLxjCcUv/4eHi161kH+9jI40iKnEKs+JirK62fL8r5J0QPFIrLS8NTEGQF+rgKA1/ vXB+SJP3g8SQqMiptPLKJNZxBbhQylppZ+0NyhhlAciLAJlTTD0Ji3xaCcbFKe3bOpw3oc 6u/xR7F+fWJvQaLsfGwSMDKiHrdWLsM= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-312-EIHpz8bEOM-rPiopF3BPTw-1; Wed, 27 Sep 2023 00:43:29 -0400 X-MC-Unique: EIHpz8bEOM-rPiopF3BPTw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C98E329AA2C4; Wed, 27 Sep 2023 04:43:28 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.193.202]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B53340C2064; Wed, 27 Sep 2023 04:43:28 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 38R4hPBs140286 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 27 Sep 2023 06:43:26 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 38R4hPoq140285; Wed, 27 Sep 2023 06:43:25 +0200 Date: Wed, 27 Sep 2023 06:43:24 +0200 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] remove workaround for GCC 4.1-4.3 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778164529768798710 X-GMAIL-MSGID: 1778164529768798710 Hi! While looking into vec.h, I've noticed we still have a workaround for GCC 4.1-4.3 bugs. As we now use C++11 and thus need to be built by GCC 4.8 or later, I think this is now never used. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2023-09-27 Jakub Jelinek * system.h (BROKEN_VALUE_INITIALIZATION): Don't define. * vec.h (vec_default_construct): Remove BROKEN_VALUE_INITIALIZATION workaround. * function.cc (assign_parm_find_data_types): Likewise. Jakub --- gcc/system.h.jj 2023-04-22 20:14:03.502203388 +0200 +++ gcc/system.h 2023-09-26 16:41:44.384204843 +0200 @@ -905,12 +905,6 @@ extern void fancy_abort (const char *, i /* Some compilers do not allow the use of unsigned char in bitfields. */ #define BOOL_BITFIELD unsigned int -/* GCC older than 4.4 have broken C++ value initialization handling, see - PR11309, PR30111, PR33916, PR82939 and PR84405 for more details. */ -#if GCC_VERSION > 0 && GCC_VERSION < 4004 && !defined(__clang__) -# define BROKEN_VALUE_INITIALIZATION -#endif - /* As the last action in this file, we poison the identifiers that shouldn't be used. Note, luckily gcc-3.0's token-based integrated preprocessor won't trip on poisoned identifiers that arrive from --- gcc/vec.h.jj 2023-07-11 13:40:40.392430080 +0200 +++ gcc/vec.h 2023-09-26 16:44:30.637902359 +0200 @@ -512,21 +512,6 @@ template inline void vec_default_construct (T *dst, unsigned n) { -#ifdef BROKEN_VALUE_INITIALIZATION - /* Versions of GCC before 4.4 sometimes leave certain objects - uninitialized when value initialized, though if the type has - user defined default ctor, that ctor is invoked. As a workaround - perform clearing first and then the value initialization, which - fixes the case when value initialization doesn't initialize due to - the bugs and should initialize to all zeros, but still allows - vectors for types with user defined default ctor that initializes - some or all elements to non-zero. If T has no user defined - default ctor and some non-static data members have user defined - default ctors that initialize to non-zero the workaround will - still not work properly; in that case we just need to provide - user defined default ctor. */ - memset (dst, '\0', sizeof (T) * n); -#endif for ( ; n; ++dst, --n) ::new (static_cast(dst)) T (); } --- gcc/function.cc.jj 2023-07-11 13:40:38.992448821 +0200 +++ gcc/function.cc 2023-09-26 16:44:54.865567722 +0200 @@ -2429,15 +2429,7 @@ 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)