From patchwork Sat Dec 9 07:04:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 176132 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5916275vqy; Fri, 8 Dec 2023 23:05:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlCfPkQBup8aez5ZKJ671qG4j1Emgm0Xt1HxeVxLMjpfSl259TDxY2ROAJaeIfMh8bRNUP X-Received: by 2002:a05:620a:12c3:b0:775:a91c:80c2 with SMTP id e3-20020a05620a12c300b00775a91c80c2mr1186755qkl.73.1702105516494; Fri, 08 Dec 2023 23:05:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702105516; cv=pass; d=google.com; s=arc-20160816; b=Zdk/nb6PjaPl0JzhQdfUsSH0dKQz6GFhwrVicch4u4W2S7SGVZEY1BcBT4+tIiNIke CsDYrbPhpzd92gNeX89V7KHtxidsLXaMhBaTr25klDWeozKghDGe7Vs5qrsw86Ad1rb8 CWVDw6ejNdsmQLZDCWtk9/CSSWmxqWJdi4ifDZcQoHwjkhVdlbHQxqZisbfWPG8y0jlE S3OEetojGI1cWhssAM8+5lurNIk9VXDLrxQZl5Q0tqL84zmApU7BNoaSo/pn4BEWjAI1 wp5CqimmstzN1AO3JSxclR5x+QP1ZAvctBdxH51rCKDPRay4Hc59hYH1dLiA4nU4jXhT mN6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent :message-id:in-reply-to:date:references:organization:subject:to:from :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=Phy69NAKm7iIccZpCwEbkL5AWK+Qak7In4iTIrvnvuU=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=TiJW4hQTLtevW1oiBFkc6pj1gUVwpd48eBQstE4v4LXcia+0uamDPHE+oJxNRVFDj2 h2ppfQiDvfGfC592cg8Hll9FliK2VlxRj/sESzKfJKkUcYBguIM/lSaxWUGVzN7TBSmy FSMdoGbOTZdvlVk7UeCQANSlrY08SbCN2oVTQO8YsE4VrDWkwg8u4YZ+NrzLFHDQollX lK6b1l/WFXpLUiyFhQ2MJAZ1UFocvO32rFWBgBWwOI5O8rTbqYOzZIUaTWGNMX+o5y5X tKW1iWOMB3s4G47VB2gxr629nOgiA+VVnjJWIWT+P01yqyTO6asCMnJOSc5QrVIr+Jq8 hr0g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=d+U4qQMs; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id de14-20020a05620a370e00b0077eff54828bsi3996401qkb.302.2023.12.08.23.05.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 23:05:16 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=d+U4qQMs; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 40E873858412 for ; Sat, 9 Dec 2023 07:05:16 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 7AE523858CD1 for ; Sat, 9 Dec 2023 07:04:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7AE523858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7AE523858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::435 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702105494; cv=none; b=ceMRJlaMNudfLshL+X452wGZBXcDNrSv/Jfa678lSfqH9RwhtUtpwjRY7/906O3h3xEHoEGpYxpXvLj6jNIkMSOI1pIP/lufvn/ChcJbc/SFnVp/+/boNP+PUvi69HWHNUNipm7BS1SM3RpzUNlcaXF4WlhGrdvh/a9aWdkncug= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702105494; c=relaxed/simple; bh=sGPwtxOJDKferafGE82WlYk3fOYqG8UQCfuXl9rzQ/Q=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=bFz4BlUMvSc0NJ6e0Wv6XJ8SwCVBsPlBE3Du5xRuhkWk5g+kD1hITPprggaPvPvHFa4cwk4YJPbu8aenOnXnkz7YenLqCX1FtHrx/Ia6zvb8kQFCOfTJ24bf4HvhRmSvLnKQ8o/dA2YLzqxZlbF2FJpnLAN7pZL9uyYO2134YGE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6ce939ecfc2so2246589b3a.2 for ; Fri, 08 Dec 2023 23:04:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1702105484; x=1702710284; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Phy69NAKm7iIccZpCwEbkL5AWK+Qak7In4iTIrvnvuU=; b=d+U4qQMsUyIHCkfjcsXvG2c78Oz6oySbFbjCMX3vaOvfY0IC5Uwxwl2BEsvTYIoTR8 eW6zeQtzloO/4MGghJF0zOJ6+OlceXPclWJYYXhbXRby7PXqx8kX/fe5zPyHLng0B1ye eH0GATRs4fY7bhgWmI3Kr6D+vq0ZvWTwVeQ9huFs/m/+kzFN441QM2HfcTT/gjfLFDZa GyUo9w7RyBdVMKntHZXa5xG9r2Pm9Nzj1acveZWLUizdKVp9Rqu2p+p3S+6o/t9De/SI E3XGX9heeXq0kWd0qpE7eIsuv6a3LsqVXOBj/jnc5KV4vIY/6MJv8Oy/PVwyH7RRNuoM IbUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702105484; x=1702710284; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:to:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=Phy69NAKm7iIccZpCwEbkL5AWK+Qak7In4iTIrvnvuU=; b=wKx3E9Ve8+/e0vcEUT1L5YaLBDD/xdaa+2mpTNIZ/h98HjdpEabUEtTu/Qux8ykU7o W9109B6cyRvbD6aWkCQx8RLtmvWo3gUPDgiIFuq3YVi2rj0Ibm2e80H5z+fX5FGgeVcP 2Do32BbPdXXqSGp95kszszdl4XlhI38hD/+gQX3XBPfbkEM4DB5xs+ZCvBg/gnF0WWtc XagejPtSNCbv73IlfCBZbwzD3P3ee4UMPI2j5L86cY5y+TnQZYi+LNSuhQ8xgsIOo1hn VINTb7w+2s5hREq316RijkFZZQsPQndpE2leKIIy2w0tU0CAVswNGWB8DH7CVj1NKrU5 7nZQ== X-Gm-Message-State: AOJu0Yw6QQfczK5cCSvc4ZdsfMHYRUr7b4nfwfvSn2+6bMVdxGB/xqWf 7CwAOEADLcRKjS+ktz9OKN1ERk9DcjNDujq3/3Ul9Q== X-Received: by 2002:a05:6a00:1303:b0:6ce:7656:5cba with SMTP id j3-20020a056a00130300b006ce76565cbamr1363015pfu.22.1702105484325; Fri, 08 Dec 2023 23:04:44 -0800 (PST) Received: from free.home ([2804:14c:4d1:44a5:f4d9:b7a4:4fb8:376f]) by smtp.gmail.com with ESMTPSA id y24-20020aa78558000000b006cee23e7677sm1992837pfn.210.2023.12.08.23.04.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 23:04:43 -0800 (PST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 3B974YHe322027 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 9 Dec 2023 04:04:35 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: [PATCH v2] -finline-stringops: check base blksize for memset [PR112778] Organization: Free thinker, does not speak for AdaCore References: Date: Sat, 09 Dec 2023 04:04:34 -0300 In-Reply-To: (Alexandre Oliva's message of "Fri, 08 Dec 2023 23:45:29 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, WEIRD_QUOTING 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784770687694499489 X-GMAIL-MSGID: 1784786994085903124 Scratch the previous one, the "slightly different version" I had before it was not entirely broken due to unnecessary, suboptimal and incorrect use of ctz. Here I have yet another implementation of that loop that should perform better and even work correctly ;-) This one has so far regstrapped on x86_64-linux-gnu (v1 failed in regression testing, sorry), and bootstrapped with -finline-stringops on ppc64le-linux-gnu (still ongoing on x86-64-linux-gnu and aarch64-linux-gnu). Ok to install? The recently-added logic for -finline-stringops=memset introduced an assumption that doesn't necessarily hold, namely, that can_store_by_pieces of a larger size implies can_store_by_pieces by smaller sizes. Checks for all sizes the by-multiple-pieces machinery might use before committing to an expansion pattern. for gcc/ChangeLog PR target/112778 * builtins.cc (can_store_by_multiple_pieces): New. (try_store_by_multiple_pieces): Call it. for gcc/testsuite/ChangeLog PR target/112778 * gcc.dg/inline-mem-cmp-pr112778.c: New. --- gcc/builtins.cc | 57 ++++++++++++++++++++---- gcc/testsuite/gcc.dg/inline-mem-cmp-pr112778.c | 10 ++++ 2 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/inline-mem-cmp-pr112778.c diff --git a/gcc/builtins.cc b/gcc/builtins.cc index 12a535d313f12..f6c96498f0783 100644 --- a/gcc/builtins.cc +++ b/gcc/builtins.cc @@ -4284,6 +4284,40 @@ expand_builtin_memset (tree exp, rtx target, machine_mode mode) return expand_builtin_memset_args (dest, val, len, target, mode, exp); } +/* Check that store_by_pieces allows BITS + LEN (so that we don't + expand something too unreasonably long), and every power of 2 in + BITS. It is assumed that LEN has already been tested by + itself. */ +static bool +can_store_by_multiple_pieces (unsigned HOST_WIDE_INT bits, + by_pieces_constfn constfun, + void *constfundata, unsigned int align, + bool memsetp, + unsigned HOST_WIDE_INT len) +{ + if (bits + && !can_store_by_pieces (bits + len, constfun, constfundata, + align, memsetp)) + return false; + + /* BITS set are expected to be generally in the low range and + contiguous. We do NOT want to repeat the test above in case BITS + has a single bit set, so we terminate the loop when BITS == BIT. + In the unlikely case that BITS has the MSB set, also terminate in + case BIT gets shifted out. */ + for (unsigned HOST_WIDE_INT bit = 1; bit < bits && bit; bit <<= 1) + { + if ((bits & bit) == 0) + continue; + + if (!can_store_by_pieces (bit, constfun, constfundata, + align, memsetp)) + return false; + } + + return true; +} + /* Try to store VAL (or, if NULL_RTX, VALC) in LEN bytes starting at TO. Return TRUE if successful, FALSE otherwise. TO is assumed to be aligned at an ALIGN-bits boundary. LEN must be a multiple of @@ -4341,7 +4375,11 @@ try_store_by_multiple_pieces (rtx to, rtx len, unsigned int ctz_len, else /* Huh, max_len < min_len? Punt. See pr100843.c. */ return false; - if (min_len >= blksize) + if (min_len >= blksize + /* ??? Maybe try smaller fixed-prefix blksizes before + punting? */ + && can_store_by_pieces (blksize, builtin_memset_read_str, + &valc, align, true)) { min_len -= blksize; min_bits = floor_log2 (min_len); @@ -4367,8 +4405,9 @@ try_store_by_multiple_pieces (rtx to, rtx len, unsigned int ctz_len, happen because of the way max_bits and blksize are related, but it doesn't hurt to test. */ if (blksize > xlenest - || !can_store_by_pieces (xlenest, builtin_memset_read_str, - &valc, align, true)) + || !can_store_by_multiple_pieces (xlenest - blksize, + builtin_memset_read_str, + &valc, align, true, blksize)) { if (!(flag_inline_stringops & ILSOP_MEMSET)) return false; @@ -4386,17 +4425,17 @@ try_store_by_multiple_pieces (rtx to, rtx len, unsigned int ctz_len, of overflow. */ if (max_bits < orig_max_bits && xlenest + blksize >= xlenest - && can_store_by_pieces (xlenest + blksize, - builtin_memset_read_str, - &valc, align, true)) + && can_store_by_multiple_pieces (xlenest, + builtin_memset_read_str, + &valc, align, true, blksize)) { max_loop = true; break; } if (blksize - && can_store_by_pieces (xlenest, - builtin_memset_read_str, - &valc, align, true)) + && can_store_by_multiple_pieces (xlenest, + builtin_memset_read_str, + &valc, align, true, 0)) { max_len += blksize; min_len += blksize; diff --git a/gcc/testsuite/gcc.dg/inline-mem-cmp-pr112778.c b/gcc/testsuite/gcc.dg/inline-mem-cmp-pr112778.c new file mode 100644 index 0000000000000..fdfc5b6f28c8e --- /dev/null +++ b/gcc/testsuite/gcc.dg/inline-mem-cmp-pr112778.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-finline-stringops" } */ + +char buf[3]; + +int +f () +{ + __builtin_memset (buf, 'v', 3); +} From patchwork Thu Dec 21 06:08:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 182005 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp212668dyi; Wed, 20 Dec 2023 22:09:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzFjolRviorDkg8cZIYOvoHfNHULvbIPHnw1N8xbW8z7xJn2L7Q7rQqiiAhnJQDjVxBJVR X-Received: by 2002:ae9:e012:0:b0:781:1f81:1fbe with SMTP id m18-20020ae9e012000000b007811f811fbemr325130qkk.50.1703138981273; Wed, 20 Dec 2023 22:09:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703138981; cv=pass; d=google.com; s=arc-20160816; b=x4BBzYCZcA+h6a97QnFqnM5v3/YPKN0mH1avi82yo4qQl+OOqD6SWKsaLtHkPSMIw/ 1/B8EBq5y7umoUkXJBiTS6czGZGCG5higsnzHfv+pa+chzdaQd43S1OpnwdfX7DmP5sd 1fYlCCt0mgYBl3Z0S1xmL5qVXuDbl3j48GY0h11hB0IVR5KosZCcBnS8e0rCkgxe4eB9 7qaw1oK0lAxFGmGer4e/S5hB9Oit3TYw0tFqP7deQpEvqJn9Vs7Jh5SbGG1t4iQQ7pYg 96aIUApzzDvMDayfS6vQVj9JA/nh98UNuXpgBO6SkOFWCDKgB/NWv+jp94cwRhN/tq7S Sygw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:dkim-signature:arc-filter :dmarc-filter:delivered-to; bh=vHgxeJtNECMvkNzpBkcnrQke0grf1CvQ2/+XorW+6CM=; fh=jW0Z4VeKI+ZH963cTdrDZio3DYNhvWfEMv/RN9QeeXo=; b=h0mNyI+xNetTzazFRbUVvvdcGAHNSQrsNOAIN2zlzXahxw1h1WNavvK3LjKEPZCY2W R9PH///Oscks+nIJqb2hkZHEEMs7WdVf5PKRFZYTyyVRn7IpfKYwx4GYLV78+KGJbkGb ht8AqrI6GsfdTBbqBC0Y+Y0U2YVyz198FgQNDw2vMupyLZSlgD2QfIne9Nd0XtZi3igw 8HqzUtiwmOhMGWK3mqb33gQ6mFzIIh4fI/Fy6zwBUrr4IDN9M65s3xT0xsi3EFWiHBVU KaeF62eBq1O48VsBJBqcPfd1ctZPyHlfigNm3CXVMV2lcszuzRqvQulkcrvLxTsIp320 5eHQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=Ag4tmgDF; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id bp42-20020a05620a45aa00b0077f01c246aesi1589846qkb.304.2023.12.20.22.09.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 22:09:41 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=Ag4tmgDF; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 030B33861891 for ; Thu, 21 Dec 2023 06:09:41 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 886DF3858404 for ; Thu, 21 Dec 2023 06:09:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 886DF3858404 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 886DF3858404 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::630 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703138958; cv=none; b=ty7PEGbHOTw1TMaMmLBFL3f6sLWUE1e2A080kZ1/wiJ018kxf/m6AK8m7AcJZGTbEtt7Zp9IJG6YqlRvmhsuHbSBgDtXd6De703BfCUv0+X0riVmscd3mJ83/2l51jwwoRFp6+Q1zMPoT9RP6AjcEvUA//cfauiENWx3dd4jHOs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703138958; c=relaxed/simple; bh=GCqCRhTuahklm+tYv+t5h9/EzQGC0Uw77rIFli4hNb0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=SLLwdbevHIcltVMPtr6BNs0a8oyu4MPKFTatXNbzzWyAmQa/Y1YHm7Nz29++sG4fZph0Vid6e6Soe5GseT8ZR4I24Vt4aabI3NJKwhv6nxBY1PH1qFLiBa/k3BlFj82pYnzrIkqTmNEaF/yWtJmZZEujkIVg/ybDTP8/J6c2aFw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1d3536cd414so3885015ad.2 for ; Wed, 20 Dec 2023 22:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1703138954; x=1703743754; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:organization:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=vHgxeJtNECMvkNzpBkcnrQke0grf1CvQ2/+XorW+6CM=; b=Ag4tmgDF5ErCc3OgJx0JBJy6dmqphDaMrrFcw7KJzfSeZ5YEKIE539KsI42VZaYugD puw+t4uuEkD+n+aZtia+U6Ghq6tp4S2b0WYNDT62I7lUVFFpdw01Sm7WpujjjVvtz/XG wldbPtWHZ5XXuFF9hLpzwmZCsSZSWY2agQ+Y50l1+TeHmkkyQQSJbWdpD2Rq1kRXhAYc 8ScK/VSUiZ3LdXVj2RZsn+ZPjR/muywIcRMR/LxQE410JpdZfVRKBy49kVD/ievtDkt3 N02bc0q5ilWjhtFxykZckhbAmOXptSDaQSzdj5nQ8TwthQiwr+xEymKjhSllSZ0WzaLX sRgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703138954; x=1703743754; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:organization:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vHgxeJtNECMvkNzpBkcnrQke0grf1CvQ2/+XorW+6CM=; b=pzYHTEs54ug+oRYHEpv63U9otYtnjmA+wsy2BBuxQ9yaqRlOEPmqn6RKaLBG3Kr8EA uPoGnpKpiu80x3LL/8lyukSIYdNGEwDT2nyym/B7Ic3wLEZFQiUBoZ+nVaLzVqAaV2no 4gDrxaVEz6VIk7eOaCVfV2c2imxjgdjVpLevkRx/g7Zbb9SPrQRNeXNsSUCQuX99dies 8VJ/sgrzNK7W/INqkx8rENdT41ENGzjwHEH8O44djrWgBqXIEb/TzMIr9Gkj2cuGTPfe LuAVpwdXC5RSDp3adUcvS0kWZZ1j7xJXyUwtOjJwXczRnUWYQrLliILLRM+Q+j3PYRHx u1xA== X-Gm-Message-State: AOJu0YwFrzpX0KGgDJzN1Ej8MpBeR3NA3B2ldTNUhYFlG7rB3+FjTXXB gDVG2vVl4OIL1k5M0XKGdYDsiw== X-Received: by 2002:a17:902:ce90:b0:1d3:df15:e032 with SMTP id f16-20020a170902ce9000b001d3df15e032mr4105978plg.21.1703138954640; Wed, 20 Dec 2023 22:09:14 -0800 (PST) Received: from free.home ([2804:7f1:2080:e946:8ecf:6d68:6986:b9a]) by smtp.gmail.com with ESMTPSA id iw17-20020a170903045100b001d3b7c5776asm739705plb.160.2023.12.20.22.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 22:09:13 -0800 (PST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 3BL68wvY735533 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 21 Dec 2023 03:09:01 -0300 From: Alexandre Oliva To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: [PATCH 2/2 FYI] -finline-stringops: drop obsolete comment [PR112778] Organization: Free thinker, does not speak for AdaCore References: Date: Thu, 21 Dec 2023 03:08:56 -0300 In-Reply-To: (Richard Biener's message of "Mon, 11 Dec 2023 08:36:42 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, WEIRD_QUOTING 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785870660087399577 X-GMAIL-MSGID: 1785870660087399577 On Dec 11, 2023, Richard Biener wrote: > On Sat, Dec 9, 2023 at 8:05 AM Alexandre Oliva wrote: >> PR target/112778 >> * builtins.cc (can_store_by_multiple_pieces): New. >> (try_store_by_multiple_pieces): Call it. >> +/* Check that store_by_pieces allows BITS + LEN (so that we don't >> + expand something too unreasonably long), and every power of 2 in >> + BITS. It is assumed that LEN has already been tested by >> + itself. */ >> +static bool >> +can_store_by_multiple_pieces (unsigned HOST_WIDE_INT bits, When fixing the PR, I failed to remove the comment that raised the very concern that the PR confirmed, and that the earlier patch for the PR fixed. I'm checking this in as obvious. for gcc/ChangeLog PR target/112778 * builtins.cc (try_store_by_multiple_pieces): Drop obsolete comment. --- gcc/builtins.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gcc/builtins.cc b/gcc/builtins.cc index 0f64feeedbad6..125ea158ebfad 100644 --- a/gcc/builtins.cc +++ b/gcc/builtins.cc @@ -4491,10 +4491,6 @@ try_store_by_multiple_pieces (rtx to, rtx len, unsigned int ctz_len, if (max_len >> max_bits > min_len >> max_bits) tst_bits = max_bits; } - /* ??? Do we have to check that all powers of two lengths from - max_bits down to ctz_len pass can_store_by_pieces? As in, could - it possibly be that xlenest passes while smaller power-of-two - sizes don't? */ by_pieces_constfn constfun; void *constfundata;