From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id D0C993858CDA for ; Mon, 25 Jul 2022 22:46:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D0C993858CDA Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26PMIm5u015721; Mon, 25 Jul 2022 22:46:03 GMT Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3hj3uu8jpd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Jul 2022 22:46:03 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 26PMZ5Gd027458; Mon, 25 Jul 2022 22:46:02 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma01dal.us.ibm.com with ESMTP id 3hg98rtvae-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Jul 2022 22:46:02 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 26PMk0Bq34865418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Jul 2022 22:46:00 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 60845C6057; Mon, 25 Jul 2022 22:46:00 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EAE23C605A; Mon, 25 Jul 2022 22:45:59 +0000 (GMT) Received: from [9.160.68.13] (unknown [9.160.68.13]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 25 Jul 2022 22:45:59 +0000 (GMT) Message-ID: <892eb3fe-617d-1b39-fae9-32c68ed8b1f9@linux.ibm.com> Date: Mon, 25 Jul 2022 17:45:58 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: [PING][PATCH] c: Handle initializations of opaque types [PR106016] (need review of expr.cc hunk) Content-Language: en-US To: GCC Patches Cc: Segher Boessenkool References: <009c391d-3994-8755-0d22-9e80faf91f42@linux.ibm.com> From: Peter Bergner In-Reply-To: <009c391d-3994-8755-0d22-9e80faf91f42@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: d6oevFvTKDt1TfW5HTtiG_FBGBj5KMJB X-Proofpoint-ORIG-GUID: d6oevFvTKDt1TfW5HTtiG_FBGBj5KMJB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-25_13,2022-07-25_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=999 clxscore=1015 bulkscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 phishscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207250092 X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H2, 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: Mon, 25 Jul 2022 22:46:06 -0000 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? > > 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]); > +}