From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id A35F9385842E for ; Wed, 17 Jan 2024 12:14:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A35F9385842E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A35F9385842E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705493661; cv=none; b=Vx6bTEOoQV2b3EZmsVj6Acj0w+jEmZT5mRbB9BQnFq+Aumjpjvp4obRWeevgglgEtVy1weXoISoQZvC1IzRL4SQ1RoUNdgfmjKGgvv+gpR5R1DDAtdTCep8PTrTcVXJDwzKJdNXvNUQfN9erambZ16zLCTgBj60KvMFW00ybuzg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705493661; c=relaxed/simple; bh=1A5xBMMSJnXYiSYAMEvN0TGkLOtF+uIw7MT5mat2DoQ=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:Message-ID:MIME-Version; b=caOIwsZO5QMlMlirzRPPh+hU6nD5NXQIm+BpBknuuuSqo3dLgEB8wDagYOXIqS6uL0D4QBvDCN8r2Y8Go+xcFDRzEee0vtbfHGvrzUr6RTKxeiGX4I5jmpOWh8cYKpBgEBsUAemHh+DjnbkP72WEZoA1HajzAdWM/S5XnBiJiPo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [10.168.4.150] (unknown [10.168.4.150]) (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 smtp-out2.suse.de (Postfix) with ESMTPS id 7BBF11FC07; Wed, 17 Jan 2024 12:14:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1705493658; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8pEM+GuKugwse8sOkCM5R1Ie7rtGPl8Qbk7ZyFUdU+U=; b=YoqpUfBk/5nsJ4JQW215Z5NnkhNGExy6bfGjtp8VLdDFINeN1ung/5syxKNUxkeTFp894Q GVvLSiDhyRkBoA6L29Vhhw1tvVLX+OTdVqrS3ioYADE8cH7d14lWC0eejU7m8HVqbBQ1FY n4Q9BXMcwKsJJNPRr/myR1aCuf8MwYE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1705493658; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8pEM+GuKugwse8sOkCM5R1Ie7rtGPl8Qbk7ZyFUdU+U=; b=R7X9Xd1Tiege9bKs0goUuACM1Zu/dRrQvK5EKxyKUwYvGtuayiE4+GKT7RZtMziHz3lWMX 6SWhOoS2VNYUCsAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1705493657; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8pEM+GuKugwse8sOkCM5R1Ie7rtGPl8Qbk7ZyFUdU+U=; b=GBvOex3xfd1nOTKKUZbDziwhXnErMgAzfldi3XyPnk5BGjXV6Pq7bn9inbIXceofFUiugH zYOMlFjqBu5A/PsWu55IjEkN2BFiv3+2P28OIz0Fv77zjQyhmIzae3uyIS/3iKxR5oxuku wEtX810qfVpMenC24MuYt2KGYflHAsY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1705493657; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8pEM+GuKugwse8sOkCM5R1Ie7rtGPl8Qbk7ZyFUdU+U=; b=r253V3xiN8LKVwwf/tlbXsZbwif1Sw2EuAMZcW70MRPpr43PVfLcrPHnm2fOhrRxHVy5uO RqXJLNBb3h1kU2Cg== Date: Wed, 17 Jan 2024 13:09:09 +0100 (CET) From: Richard Biener To: Jakub Jelinek cc: Alexandre Oliva , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] ipa-strub: Fix handling of _BitInt returns [PR113406] In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-0.13 / 50.00]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.03)[55.32%]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[ipa-strub.cc:url,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com] X-Spam-Level: X-Spam-Score: -0.13 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 17 Jan 2024, Jakub Jelinek wrote: > Hi! > > Seems pass_ipa_strub::execute contains a copy of the expand_thunk > code I've changed for _BitInt in r14-6805 PR112941 - larger _BitInts > are aggregate_value_p even when they are is_gimple_reg_type. > > Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, > ok for trunk? OK. > 2024-01-17 Jakub Jelinek > > PR middle-end/113406 > * ipa-strub.cc (pass_ipa_strub::execute): Check aggregate_value_p > regardless of whether is_gimple_reg_type (restype) or not. > > * gcc.dg/bitint-70.c: New test. > > --- gcc/ipa-strub.cc.jj 2024-01-03 11:51:28.374775006 +0100 > +++ gcc/ipa-strub.cc 2024-01-16 10:51:03.987463928 +0100 > @@ -3174,21 +3174,16 @@ pass_ipa_strub::execute (function *) > resdecl, > build_int_cst (TREE_TYPE (resdecl), 0)); > } > - else if (!is_gimple_reg_type (restype)) > + else if (aggregate_value_p (resdecl, TREE_TYPE (thunk_fndecl))) > { > - if (aggregate_value_p (resdecl, TREE_TYPE (thunk_fndecl))) > - { > - restmp = resdecl; > + restmp = resdecl; > > - if (VAR_P (restmp)) > - { > - add_local_decl (cfun, restmp); > - BLOCK_VARS (DECL_INITIAL (current_function_decl)) > - = restmp; > - } > + if (VAR_P (restmp)) > + { > + add_local_decl (cfun, restmp); > + BLOCK_VARS (DECL_INITIAL (current_function_decl)) > + = restmp; > } > - else > - restmp = create_tmp_var (restype, "retval"); > } > else > restmp = create_tmp_reg (restype, "retval"); > --- gcc/testsuite/gcc.dg/bitint-70.c.jj 2024-01-16 11:01:48.300524130 +0100 > +++ gcc/testsuite/gcc.dg/bitint-70.c 2024-01-16 11:01:19.456924333 +0100 > @@ -0,0 +1,14 @@ > +/* PR middle-end/113406 */ > +/* { dg-do compile { target bitint } } */ > +/* { dg-options "-std=c23 -fstrub=internal" } */ > +/* { dg-require-effective-target strub } */ > + > +#if __BITINT_MAXWIDTH__ >= 146 > +_BitInt(146) > +#else > +_BitInt(16) > +#endif > +foo (void) > +{ > + return 0; > +} > > Jakub > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)