From patchwork Sat Dec 9 14:32:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 176189 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6080348vqy; Sat, 9 Dec 2023 06:32:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqlGYtoxi5pY4r3hFRuCTQ2xDBwJSlkSvdaCixPw87OUZAOqkH4RS3lK5v7EOdwG3VITMQ X-Received: by 2002:a67:c091:0:b0:460:7b72:894f with SMTP id x17-20020a67c091000000b004607b72894fmr1391365vsi.33.1702132376867; Sat, 09 Dec 2023 06:32:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702132376; cv=pass; d=google.com; s=arc-20160816; b=exYwIs39KnikKinbGW+0fdnJIWvaBuRwcqc/RjWeT3XB8NwThBS3I+MA5mVcuPCi/j zJJ2ar0Gj7AIbDsd4FaCAszkvc1+5izMPlPcS0QcudqiRXPvXw43kEQPty5xR9hCgl+T 7+dex3qKboLeXRRWszwXfb6Hf1k2Ysi7QDQlxkUaiHqL3MdkJCsCX5/HVB+jkFdyP5Ug d9lvJCVog8YCybKAgP92er1HvU5ayVDcoLdo4/3WRgam4R19zl/our8y13RdYTDJP+mQ pnWKaBXATWQEaWhjaFfk08BXAQAFbp7fhQYA/fGwuNsTgVx+fX8x0pF7q/BqZEUUHDto OLtg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=XrZv1DwvNUGf9+r0Aq9USkjdnHwrZmeOhuAqYNNQaqI=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=tlDjrShc6MG/XHoJVfDLSPfECJt7PAWnhXQRY6cwrvk5A/gLYEwg1bXtntYtkV9HgV iiuITGMMQ9AIHDGguD5NLqOVl/qDTkMskTLhNNAhOkDOZ86a0qxADYgSzsYur3BTJrNe 9ZguqgOfbb5mJUem4okuGLrE01qJ94/6vhGiEPZU99ysOpEK7aBXNjPOjprLz0bVIIYu zYDY+0bqDy31pmBKXA0B9ELt53T4bI50XwNB8cIBbyQUSmDAaK4lE4h4ZZBnDCOT3qOh KpGd0LolHNmtFDZW0ejUOkb/sMCNrBjrOFG9Jc/pRpVZXDrkju8YKCSe3ShpmhwCBb1X tqHA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RVuNepCg; 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=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id y9-20020a67bd09000000b0046453628219si805047vsq.732.2023.12.09.06.32.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 06:32:56 -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=@redhat.com header.s=mimecast20190719 header.b=RVuNepCg; 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=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7FC1B3858410 for ; Sat, 9 Dec 2023 14:32:56 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 11BEE3858410 for ; Sat, 9 Dec 2023 14:32:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 11BEE3858410 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 11BEE3858410 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702132355; cv=none; b=Q8mbIMaLalNl5o2U+LHVlQc/owWQyURyccMZRDpZW2YS1DqowVog1OA0/ljbl1fqk1lYROpwHtLAAjAzMnjG3ke6eLC9QiccpFEmzo1Lv3v+fKU6ioxSypPCLMM3KWgOLfSQuNc1AV5S7VUmSbSx0UPQ4Nf/5Hx3vMkUuPxq0gM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702132355; c=relaxed/simple; bh=i0XwO/mEeInzvviWDzlf0vlOgMBGN2m5sFN65b9q708=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=UMyz7N88lpgpBrJg725xqDxHQN1zKGAA5aaVoTUqxWU8liKJ5GlrwkMEnagRI/dTnydcFsqkEEUTceoLYQnJo9LTHagPztbs0LGYS/MJNGGndCLIxONKnvwkIhQjo8HgG7IMu0k1BbfqRiN6Q1XurNkq50WXB7QYJeU66MUvcL0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702132344; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type; bh=XrZv1DwvNUGf9+r0Aq9USkjdnHwrZmeOhuAqYNNQaqI=; b=RVuNepCg/8H4H3v3+aPAMYROjLrw/hUGjATSNMDkaJwKTspgvCLoUPMQBeGKoNDe9ml4H2 ai98VR0vpCSpwa9a7TiuRZjdFeIzx9z8yDdpQSrm2vXsrLOrrOwWX1mD59hGxN5Hb7Odff KCF/dYONIx9mH9TGd4hj9N05L/PVPEs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-593-_sA6c8HLM_eAG5R1kN7O9g-1; Sat, 09 Dec 2023 09:32:23 -0500 X-MC-Unique: _sA6c8HLM_eAG5R1kN7O9g-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1DB1E833944 for ; Sat, 9 Dec 2023 14:32:23 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.157]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D601D492BC6 for ; Sat, 9 Dec 2023 14:32:22 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3B9EWF5j1459607 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Sat, 9 Dec 2023 15:32:15 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3B9EWElm1459606 for gcc-patches@gcc.gnu.org; Sat, 9 Dec 2023 15:32:14 +0100 Date: Sat, 9 Dec 2023 15:32:14 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] testsuite: Add testcase for already fixed PR [PR112924] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784815158945579729 X-GMAIL-MSGID: 1784815158945579729 Hi! This testcase got fixed with r14-6132-g50f2a3370d177f8fe9bea0461feb710523e048a2 . I'm just adding a testcase so that it doesn't reappear. Tested on x86_64-linux, with -m32/-m64, current trunk as well as r14-6131 where it ICEd with -m32, committed to trunk as obvious. 2023-12-09 Jakub Jelinek PR tree-optimization/112924 * gcc.dg/pr112924.c: New test. Jakub --- gcc/testsuite/gcc.dg/pr112924.c.jj 2023-12-09 15:28:00.848388123 +0100 +++ gcc/testsuite/gcc.dg/pr112924.c 2023-12-09 15:27:34.401752018 +0100 @@ -0,0 +1,26 @@ +/* PR tree-optimization/112924 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -w" } */ +/* { dg-additional-options "-msse2" { target i?86-*-* x86_64-*-* } } */ + +struct S { long a; char b[64]; }; +void foo (struct S a); +char c; +int d[3541]; + +static void +bar (struct S *s, char *p) +{ + unsigned int a = sizeof (d) - sizeof (int) - s->a; + long c = __builtin_object_size (s, 0); + for (; a >= 64; a -= 64, p += 4); + __builtin___memcpy_chk (s, p, a, c); +} + +void +baz (void) +{ + struct S s = {}; + bar (&s, &c); + foo (s); +}