From patchwork Tue Sep 3 08:42:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1979935 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=jdIThk2K; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=37zH1JUl; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=jdIThk2K; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=37zH1JUl; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfK34GDXz1yZ9 for ; Tue, 3 Sep 2024 18:43:03 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D57C5385E836 for ; Tue, 3 Sep 2024 08:43:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id B6C4F3858401 for ; Tue, 3 Sep 2024 08:42:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B6C4F3858401 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 B6C4F3858401 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=1725352962; cv=none; b=RO5qTXH+KHt6CCcfMD84HSESW5YdLu5+ux5+bkttIFBBRZWlqfQBAcMtALrJc2DdSz099XDSyKmSz7Pz7K4dUidLHG6eTmYZvpc5Q0hG+yXcP66aQbnmqFKSMtvn8/XDqLPEe6U5AbyheJZdY13YNsxSo10GmvUHz6CMGltN3Kk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725352962; c=relaxed/simple; bh=L9m6GivhOH2fMFy0+23kdJFWEZP5W1o5oywX3OlSrvc=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version:Message-Id; b=cOJYlPI6/dZt0zth3pPwBxi/5vWHZKIbd5TbngUjDZHrIHeWex/7xDsfUJ7ntfwcF+1TqBDZo9ZI+Q2lvGxYaYDItL6mX2ao+O3tC0fVA4ZRpyrqDcq0+KHmpiuAyJw1+rg/g6cN02xCNIM3jpQNJ9aD7sjteuivjM07IpDnpcM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (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 819331F7CD for ; Tue, 3 Sep 2024 08:42:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1725352959; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=c4Q8JqivUQ/LYXtK5nrqvCe70ehGBwrTzREx2rBTY0k=; b=jdIThk2KAKi/L6Xy/QG3ztUUC/gXhQo4CB0DBHvsZoyDoK6n2QAT3ABBmlvmk1K8GCXm/g faTeGnSvVKe+IgwNKvIismd2JcPEZRKpIh7ElXbCInSvRVve5DKCgd2JDT3r7pJUG32zZL U3Eq2Y8Zrk+bHLzsccg7oegDYqRmnMw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1725352959; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=c4Q8JqivUQ/LYXtK5nrqvCe70ehGBwrTzREx2rBTY0k=; b=37zH1JUlMD5XR16SfcYOpWf5OQQZibRw7ByAjh/bStkJ6eJ0Kap3drIOcYsr7Q0q1vymk5 xPa9EY4qIbcg+UDQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1725352959; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=c4Q8JqivUQ/LYXtK5nrqvCe70ehGBwrTzREx2rBTY0k=; b=jdIThk2KAKi/L6Xy/QG3ztUUC/gXhQo4CB0DBHvsZoyDoK6n2QAT3ABBmlvmk1K8GCXm/g faTeGnSvVKe+IgwNKvIismd2JcPEZRKpIh7ElXbCInSvRVve5DKCgd2JDT3r7pJUG32zZL U3Eq2Y8Zrk+bHLzsccg7oegDYqRmnMw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1725352959; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=c4Q8JqivUQ/LYXtK5nrqvCe70ehGBwrTzREx2rBTY0k=; b=37zH1JUlMD5XR16SfcYOpWf5OQQZibRw7ByAjh/bStkJ6eJ0Kap3drIOcYsr7Q0q1vymk5 xPa9EY4qIbcg+UDQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 678D813A80 for ; Tue, 3 Sep 2024 08:42:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id HxSaF//L1mbJaAAAD6G6ig (envelope-from ) for ; Tue, 03 Sep 2024 08:42:39 +0000 Date: Tue, 3 Sep 2024 10:42:34 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Do not assert NUM_POLY_INT_COEFFS != 1 early MIME-Version: 1.0 Message-Id: <20240903084239.678D813A80@imap1.dmz-prg2.suse.org> X-Spam-Score: -4.30 X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; SUBJECT_HAS_EXCLAIM(0.00)[]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; PREVIOUSLY_DELIVERED(0.00)[gcc-patches@gcc.gnu.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[fold-const.cc:url] X-Spam-Level: X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org The following moves the assert on NUM_POLY_INT_COEFFS != 1 after INTEGER_CST processing. Bootstrap and regtest running on x86_64-unknown-linux-gnu, pushed as obvious after getting into stage3. * fold-const.cc (poly_int_binop): Move assert on NUM_POLY_INT_COEFFS after INTEGER_CST processing. --- gcc/fold-const.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc index 2ada59f712b..70db16759d0 100644 --- a/gcc/fold-const.cc +++ b/gcc/fold-const.cc @@ -1241,7 +1241,6 @@ poly_int_binop (poly_wide_int &res, enum tree_code code, const_tree arg1, const_tree arg2, signop sign, wi::overflow_type *overflow) { - gcc_assert (NUM_POLY_INT_COEFFS != 1); gcc_assert (poly_int_tree_p (arg1) && poly_int_tree_p (arg2)); if (TREE_CODE (arg1) == INTEGER_CST && TREE_CODE (arg2) == INTEGER_CST) @@ -1254,6 +1253,8 @@ poly_int_binop (poly_wide_int &res, enum tree_code code, return true; } + gcc_assert (NUM_POLY_INT_COEFFS != 1); + switch (code) { case PLUS_EXPR: