From patchwork Mon Nov 13 12:39:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 164454 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1172144vqg; Mon, 13 Nov 2023 04:40:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFU4z+Hj6tk07Gf+xTdHDwBtBDuM5iGIVNot5ZA7CiV1Niibdtszzu/+dlZdEtO2C0XCP46 X-Received: by 2002:a25:1ed5:0:b0:dae:e7d8:26f0 with SMTP id e204-20020a251ed5000000b00daee7d826f0mr5203799ybe.54.1699879222877; Mon, 13 Nov 2023 04:40:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699879222; cv=pass; d=google.com; s=arc-20160816; b=0OqkrZOZBJ0nj1FXKi7Hp+s4oc8bzakKVOYnzt0ZtrjUpp1KIDJTJYpa34ecGWqeVr CbbfcMOoUoLoGRbZUC2wlluHg8xfhWDqKagp9F2wJ2sb3AeQNoiR/Lz/8eCQHbVMs7PQ DvDFgde39iKaXAl3MXDLEUZqGpLU8GoHUWU57D5a/hczxEdSdRjPosLjbgEpdx3Tg5PW IwAf9F5eWqwxAGoCEdKrfhmlzKELHkrVSEdUiDuKlF4BTyEdg7r73enBqquf7T/R8GQv d5g4yH+yPRYyVBa0kxdjFn7vuzwDC3OyjU1GfAOqL4BRhkUS3P7JKaSdCxCmX07/2mEa LeuA== 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:message-id:mime-version:subject :to:from:date:dkim-signature:dkim-signature:arc-filter:dmarc-filter :delivered-to; bh=zLDbgCuILIqNQ1lEU2qYU3Y9om2YwHZrjzPT9gcrVGI=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=dEYnigV4RlOh3DOn/raFkTi+Cc+KplHvCY6jKmtUOEky/Uxcc0eb6yPRtloAiK86ZH p3KeFHxo1TmXSYxnoMO6PgJkkC770vke+Y5FB1b/aBAsZyvkykzpAOgthZV36TIImPo5 WF+lNFJF2pKadQ9QWd3+MiR9UIM8k59YQf6Y2bH3BiOqUGihoSlrsxWiyd2Yl7zZ27jE iBVzskNlgrp3n+2VkbgGxROpj0Xf3vDO0SXPZHgM9CABl/4oQUy6AiWBHvYCs2ccLyha dau/f82HWn4uJvG64OXSCAwiTCXah1O86piUf8x4NczYOhCCmlfGH3lCamQOd47plbP0 7kyQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=A3r7FHNx; dkim=neutral (no key) header.i=@suse.de; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id l18-20020ad44092000000b0066d132b1c94si4568160qvp.32.2023.11.13.04.40.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 04:40:22 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=A3r7FHNx; dkim=neutral (no key) header.i=@suse.de; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A13B7385AC26 for ; Mon, 13 Nov 2023 12:40:22 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 45F8B3858C52 for ; Mon, 13 Nov 2023 12:39:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 45F8B3858C52 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 45F8B3858C52 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:67c:2178:6::1c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699879200; cv=none; b=iNFaeGSnJmXmXoczKBIF1AXsB0bXylWduW0y+rm7W6RK2eOppvcVpVkKqul1aVIi6C6nY/am5uE+HpRIhsYhjjNLPzd8k2kQG5qUi/2HgeclKLv/sk2dc8Fo/XgmwI7XOfA89bC10lgGdq70RF9gSDYJw+RIcldA34gOl8b0ym0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699879200; c=relaxed/simple; bh=ITRqvc+4faNlG3/30cveivdtOrp2qqoVbussbTd6PhY=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:MIME-Version: Message-Id; b=HLk9+QwIQUOsdXh2MR16Je00xN0G0wxK8Wl0rxT/iPJ8ermRJaOTOJPHMNb4IFAG9O+LfDrwPTlYug9IsRvaEM4OvbjPxajH6C2hnhwL4NgAyN8gqDpjOywny12f0U/KwWCFMsM9FOFlIThcXfjLFp2kCrDYDxD8kg4cj6TdoTE= ARC-Authentication-Results: i=1; server2.sourceware.org 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-out1.suse.de (Postfix) with ESMTPS id 37D0D218F0 for ; Mon, 13 Nov 2023 12:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1699879198; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=zLDbgCuILIqNQ1lEU2qYU3Y9om2YwHZrjzPT9gcrVGI=; b=A3r7FHNxgwD4GKIMEKLyYSbRQw0cWFlpeeeqPUPQIwvaaHb059UrF+xHqhnd8hXPm30kge b5UNeMKQvztW3GWMsGX9seZHgpEyuFgQ/tuS30CsCc5WbDagBa3niPJrFQRB2zz8x6Y7DN agceoMPq/JytSHNr4day9W+KChkjDDw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1699879198; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=zLDbgCuILIqNQ1lEU2qYU3Y9om2YwHZrjzPT9gcrVGI=; b=2Vgo/xpLaSa2MUeY/vi9ZrHCPIfT1e+pyEUleR+FGXiq1Cbp62DUNVir62ObA7zMK341NV ugocQVyASaQNybCA== 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 22A821358C for ; Mon, 13 Nov 2023 12:39:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YJBsBx4ZUmXhbgAAMHmgww (envelope-from ) for ; Mon, 13 Nov 2023 12:39:58 +0000 Date: Mon, 13 Nov 2023 13:39:57 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/111792 - new testcase MIME-Version: 1.0 Message-Id: <20231113123958.22A821358C@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.2 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782452555931118897 X-GMAIL-MSGID: 1782452555931118897 This was fixed as part of the PR111000 fix. Tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/111792 PR tree-optimization/111000 * gcc.dg/torture/pr111792.c: New testcase. --- gcc/testsuite/gcc.dg/torture/pr111792.c | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/pr111792.c diff --git a/gcc/testsuite/gcc.dg/torture/pr111792.c b/gcc/testsuite/gcc.dg/torture/pr111792.c new file mode 100644 index 00000000000..58ae6f149d1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr111792.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-require-effective-target lp64 } */ + +int c, d, h, i, j, l, *n = &h; +short e, f, g, *k, m; +long o; +short p(short p1, int q) { return q >= 32 || p1 > 5 >> q ? 1 : p1 << q; } +long u(unsigned p1) +{ + int r = 50, s, *t = &c; + L: + m && (*k = 0); + for (d = 1; d; d--) + for (s = 0; s < 3; s++) { + *n = i ^ p1; + *t = p1 > (unsigned)p((unsigned)(o = 4073709551615) >= p1 && 5, r); + if (f) + goto L; + } + for (; e < 1;) + return j; + int *b[2] = {&s, &r}; + for (; l; l--) { + long a[1]; + for (r = 0; r < 1; r++) { + h = a[0]; + if (g) + goto L; + } + } + return 0; +} +int main() +{ + u(6); + if (c != 1) + __builtin_abort(); + return 0; +}