From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id 6E0733858D32 for ; Tue, 26 Jul 2022 06:57:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6E0733858D32 Received: by mail-ed1-x52d.google.com with SMTP id f15so8151466edc.4 for ; Mon, 25 Jul 2022 23:57:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3bNWlk3um5hZSiGVG6P5IHwPRhzN8oJn0tKQ7ZJJhMs=; b=a9KOEqODrxf9iwWpCKinFjYu8LtOarTfFqICeBRATpUvEEJIJfZDExOQQZOEsszlTW zjL1fuQDu4/NXsFDaKX5Jwk+vCDZKJfYkL251Vh8FyaHyQ2yOR7E7r/D+ztMLqQHzwgF rDOq6uCyuqc5hck6d1Wf/jEWVjcdHN1cz1HHT+W0TU7pUclv6IuGLJVoFQMk1GN1aiDd 0ovod8jVOxos92CglQu/XS2Z0tA+sncNsJQUI8vqhmk6YmqTkB7tyYoZseB9rG5+j00P JChfA1mzaXU690hL0TKyS19SclQRQFnhr0O+Qjq83fmBmEFXL9gM4QlktQosB+FQ3wFO Uj4A== X-Gm-Message-State: AJIora/ahF1bNrR8LUkl+F66hJuvFhzovCILQ/elJwXSYDPuICzp2GQI pYrFzw6zsBX7g2vjtHQTuNga8lFoZrK9jWz3gO0= X-Google-Smtp-Source: AGRyM1v86YzqrMeOMQQrzs7SmbZgucQfrw84rqFGbGMb+u3zTlXtuzQKhK/wAVE0UyB4WJkoCJfU6tntVTNy2iWpuPY= X-Received: by 2002:aa7:c948:0:b0:43c:78d2:8dd7 with SMTP id h8-20020aa7c948000000b0043c78d28dd7mr836918edt.370.1658818653293; Mon, 25 Jul 2022 23:57:33 -0700 (PDT) MIME-Version: 1.0 References: <009c391d-3994-8755-0d22-9e80faf91f42@linux.ibm.com> <892eb3fe-617d-1b39-fae9-32c68ed8b1f9@linux.ibm.com> In-Reply-To: <892eb3fe-617d-1b39-fae9-32c68ed8b1f9@linux.ibm.com> From: Richard Biener Date: Tue, 26 Jul 2022 08:57:20 +0200 Message-ID: Subject: Re: [PING][PATCH] c: Handle initializations of opaque types [PR106016] (need review of expr.cc hunk) To: Peter Bergner Cc: GCC Patches , Segher Boessenkool Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2022 06:57:39 -0000 On Tue, Jul 26, 2022 at 12:46 AM Peter Bergner via Gcc-patches wrote: > > I'd like to ping the following patch. Segher has approved the > test case change, so I just need a review for the expr.cc change. > > Peter > > > > Message-ID: <009c391d-3994-8755-0d22-9e80faf91f42@linux.ibm.com> > Date: Fri, 17 Jun 2022 23:50:35 -0500 > To: GCC Patches > Subject: [PATCH] c: Handle initializations of opaque types [PR106016] > > > On 6/17/22 11:50 PM, Peter Bergner via Gcc-patches wrote: > > The initial commit that added opaque types thought that there couldn't > > be any valid initializations for variables of these types, but the test > > case in the bug report shows that isn't true. The solution is to handle > > OPAQUE_TYPE initializations just like the other scalar types. > > > > This passed bootstrap and regtesting with no regressions on powerpc64le-linux. > > Ok for trunk? This is an issue in GCC 12 and 11 too. Ok for the release > > branches after some burn-in on trunk? OK. Richard. > > Peter > > > > gcc/ > > PR c/106016 > > * expr.cc (count_type_elements): Handle OPAQUE_TYPE. > > > > gcc/testsuite/ > > PR c/106016 > > * gcc.target/powerpc/pr106016.c: New test. > > > > diff --git a/gcc/expr.cc b/gcc/expr.cc > > index 78c839ab425..1675198a146 100644 > > --- a/gcc/expr.cc > > +++ b/gcc/expr.cc > > @@ -6423,13 +6423,13 @@ count_type_elements (const_tree type, bool for_ctor_p) > > case OFFSET_TYPE: > > case REFERENCE_TYPE: > > case NULLPTR_TYPE: > > + case OPAQUE_TYPE: > > return 1; > > > > case ERROR_MARK: > > return 0; > > > > case VOID_TYPE: > > - case OPAQUE_TYPE: > > case METHOD_TYPE: > > case FUNCTION_TYPE: > > case LANG_TYPE: > > diff --git a/gcc/testsuite/gcc.target/powerpc/pr106016.c b/gcc/testsuite/gcc.target/powerpc/pr106016.c > > new file mode 100644 > > index 00000000000..3db8345dcc6 > > --- /dev/null > > +++ b/gcc/testsuite/gcc.target/powerpc/pr106016.c > > @@ -0,0 +1,14 @@ > > +/* PR target/106016 */ > > +/* { dg-require-effective-target power10_ok } */ > > +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ > > + > > +/* Make sure we do not ICE on the following test case. */ > > + > > +extern void bar (__vector_quad *); > > + > > +void > > +foo (__vector_quad *a, __vector_quad *b) > > +{ > > + __vector_quad arr[2] = {*a, *b}; > > + bar (&arr[0]); > > +} >