From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id 335BF3858035; Wed, 27 Sep 2023 08:39:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 335BF3858035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695803988; bh=0HMN2oWWVOxz8+XUIufoT2xpf70tBHfahN1HJS+9sQ8=; h=From:To:Subject:Date:From; b=sFfMXKRytsNBBOKxiMgs0Nwdw4a/3peTGR6CL3DYsdHGl1ppUxIhztTW6/kw0fe3v rFjHehv8DgS+Ytw5n4wnAS9/KTbpuFYkOy5g2lHY7myWF0D9wWxkBRGr83od4BV9va L382GMiKjnUML5xYGtsklq7BRDX74DJCeVGuCfWg= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-4293] remove workaround for GCC 4.1-4.3 [PR105606] X-Act-Checkin: gcc X-Git-Author: Jakub Jelinek X-Git-Refname: refs/heads/master X-Git-Oldrev: fcbbf158ee90400877f81185bb40b5870dca1558 X-Git-Newrev: 3ba882c7b51ab1f14c62c748e989415834ccd9ce Message-Id: <20230927083948.335BF3858035@sourceware.org> Date: Wed, 27 Sep 2023 08:39:48 +0000 (GMT) List-Id: https://gcc.gnu.org/g:3ba882c7b51ab1f14c62c748e989415834ccd9ce commit r14-4293-g3ba882c7b51ab1f14c62c748e989415834ccd9ce Author: Jakub Jelinek Date: Wed Sep 27 10:38:54 2023 +0200 remove workaround for GCC 4.1-4.3 [PR105606] 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. 2023-09-27 Jakub Jelinek PR c++/105606 * 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. Diff: --- gcc/function.cc | 8 -------- gcc/system.h | 6 ------ gcc/vec.h | 15 --------------- 3 files changed, 29 deletions(-) diff --git a/gcc/function.cc b/gcc/function.cc index dd2c1136e07..e92384a8907 100644 --- a/gcc/function.cc +++ b/gcc/function.cc @@ -2429,15 +2429,7 @@ assign_parm_find_data_types (struct assign_parm_data_all *all, tree parm, { 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) diff --git a/gcc/system.h b/gcc/system.h index 5109c60c600..e924152ad4c 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -905,12 +905,6 @@ extern void fancy_abort (const char *, int, const char *) /* 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 diff --git a/gcc/vec.h b/gcc/vec.h index 6f7b0487eb6..8a9a8d83de5 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -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 (); }