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 49AF33858D35 for ; Fri, 17 Dec 2021 08:50:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 49AF33858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz 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 0E7CD1F389; Fri, 17 Dec 2021 08:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1639731027; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zsMPZQ9AGHuatRRkZe8gnXwplvYcT6OOqdfZAxh587I=; b=bSsp6BqN3MPMuTuL/oGz8OFNgvBsAxE8vISgJoBfCI8pdYPDhTAg9ijSIIFskyv0Ym14Oy Z8UF+UplSdiEIBz1EH+fUkUPdQR2WmFmaimKaKTew0w0abG5DG5jjdDYTAGU0t5l/qaXkL rK/zmtQqDP/XGuYWfHTXOxTelH6+R58= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1639731027; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zsMPZQ9AGHuatRRkZe8gnXwplvYcT6OOqdfZAxh587I=; b=Wdff4L5OO5L7MAc5NW1uvuLdUZnFc/JhfYC3OttlPFMLbrQz8VXplpp6MR2jkXNfxyrj7E Zres7RmnHsf/dWCQ== 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 DFFDC13F28; Fri, 17 Dec 2021 08:50:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WM5eNVJPvGEYfwAAMHmgww (envelope-from ); Fri, 17 Dec 2021 08:50:26 +0000 Message-ID: Date: Fri, 17 Dec 2021 09:50:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH] i386: simplify cpu_feature handling Content-Language: en-US To: Stefan Kneifel , Jakub Jelinek Cc: gcc-patches@gcc.gnu.org References: <20211214102828.GU2646553@tucnak> <80d628c2-ea0d-c542-b0bb-399d83b7292d@suse.cz> <20211214161219.GX2646553@tucnak> <7b55d00c-4ce0-3377-d0db-c9efcd32b843@bluewin.ch> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: <7b55d00c-4ce0-3377-d0db-c9efcd32b843@bluewin.ch> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 17 Dec 2021 08:50:29 -0000 On 12/16/21 21:58, Stefan Kneifel wrote: > Am 15.12.21 um 10:57 schrieb Martin Liška: >> On 12/14/21 17:12, Jakub Jelinek wrote: >>> I'd use INT_TYPE_SIZE - 1 instead of 31. Otherwise LGTM. >> >> Installed with that change, thanks. >> >> Moreover, I'm suggesting a simplification: >> >> The patch removes unneeded loops for cpu_features2 and CONVERT_EXPR >> that can be simplified with NOP_EXPR. >> >> Survives i386.exp tests, may I install the patch after testing or >> is it a stage1 material? >> >> Thanks, >> Martin > > The loops indeed seem to be unnecessary. > > For safety reasons: what would you think about throwing an ICE if (index >= SIZE_OF_CPU_FEATURES) ? > This should not happen - however, a lot of things shouldn't happen... and it might facilitiate locating a potential bug at a later time. Hello. Well, I see your point, but I don't think it's necessary as the macro is well defined. Note we have a ASAN and UBSAN bootstrap that would caught such an error. Cheers, Martin > > Regards, Stefan >