From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id B41CB38582AD for ; Tue, 6 Sep 2022 10:41:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B41CB38582AD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BBFD11F9BF; Tue, 6 Sep 2022 10:41:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662460906; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gkePwbSe2POAFQZiTkCQiEffiXvJgkVzbrkRv9y9jFk=; b=xlmzOxpzJwK+UGP+3+uMX7nZexj4sZZ72v1XTRR8xOiZqSlYuBujN3LGwgvxMGVPSjg6NE 05Il4Z8LmcM8gqQ/G1Sg+OvHBXz502Bas4P5hl1LR4Yb9Gh/NftpR3+V4+TunMVvOapcdV mmwgDIhW1Jp2RNlhTLCVW9Qcn1T4Xzo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662460906; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gkePwbSe2POAFQZiTkCQiEffiXvJgkVzbrkRv9y9jFk=; b=paBicc7aiOq/qVpPkUbV/IyCBx8NX63ehPAkk2kS9vpQKjbIM8BpLjHMafBWUoXEOnDOtd 45nP1LkzMNM5awAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 990B813A7A; Tue, 6 Sep 2022 10:41:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id rBzjI+ojF2MdEAAAMHmgww (envelope-from ); Tue, 06 Sep 2022 10:41:46 +0000 Message-ID: <6d2699eb-e306-1aa2-7691-1117c00bbb85@suse.de> Date: Tue, 6 Sep 2022 12:41:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH] nvptx: Silence unused variable warning Content-Language: en-US To: Jan-Benedict Glaw , gcc-patches@gcc.gnu.org References: <20220828110925.gxuejmyvilvqy66h@lug-owl.de> From: Tom de Vries In-Reply-To: <20220828110925.gxuejmyvilvqy66h@lug-owl.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,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 8/28/22 13:09, Jan-Benedict Glaw wrote: > Hi! > > The nvptx backend defines ASM_OUTPUT_DEF along with > ASM_OUTPUT_DEF_FROM_DECLS. Much like the rs6000 coff target, nvptx > triggers an unused variable warning: > > /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o varasm.o -MT varasm.o -MMD -MP -MF ./.deps/varasm.TPo ../../gcc/gcc/varasm.cc > ../../gcc/gcc/varasm.cc: In function 'void output_constant_pool_contents(rtx_constant_pool*)': > ../../gcc/gcc/varasm.cc:4318:21: error: unused variable 'name' [-Werror=unused-variable] > 4318 | const char *name = XSTR (desc->sym, 0); > | ^~~~ > cc1plus: all warnings being treated as errors > make[1]: *** [Makefile:1145: varasm.o] Error 1 > > > Fixed the same way: > > diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h > index ed72c253191..71297440566 100644 > --- a/gcc/config/nvptx/nvptx.h > +++ b/gcc/config/nvptx/nvptx.h > @@ -321,6 +321,9 @@ struct GTY(()) machine_function > #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ > do \ > { \ > + (void) (FILE); \ > + (void) (LABEL1); \ > + (void) (LABEL2); \ > gcc_unreachable (); \ > } \ > while (0) > > > Ok for HEAD? > LGTM. Thanks, - Tom