From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0CDE43858D1E; Tue, 20 Jun 2023 16:05:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0CDE43858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687277126; bh=j7pT8N+0AvGtikWawqq6Ua3YZH07DmNGzVNhsz2vYE0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Limbns0gTZxwqAfzoSTuIXfgHJxLZKWH8Y2ctXOMA5SrT7g+6McGoSdLd5M8Xix1J 28ZR8LKlHEAb993NU6WcSpshCtrkfSNhwvSqRLTMflD0LRwKnBa0NIn/VemF5kbtyJ x7gKx8fkCxWGjGYntl3wNCLnS8icuYpe91JdnoL4= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/110237] gcc.dg/torture/pr58955-2.c is miscompiled by RTL scheduling after reload Date: Tue, 20 Jun 2023 16:05:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110237 --- Comment #6 from Hongtao.liu --- (In reply to rguenther@suse.de from comment #5) > On Tue, 20 Jun 2023, crazylht at gmail dot com wrote: >=20 > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110237 > >=20 > > --- Comment #4 from Hongtao.liu --- > > (In reply to Richard Biener from comment #3) > > > This looks like the same issue as PR110309. We have > > >=20 > > > (insn 38 35 39 3 (set (mem:V16SI (plus:DI (reg:DI 40 r12 [orig:90 _22= ] [90]) > > > (const:DI (plus:DI (symbol_ref:DI ("b") [flags 0x2]=20 > > > ) > > > (const_int -4 [0xfffffffffffffffc])))) [1 MEM > > > [(int *)vectp_b.12_28]+0 S64 A32]) > > > (vec_merge:V16SI (reg:V16SI 20 xmm0 [118]) > > > (mem:V16SI (plus:DI (reg:DI 40 r12 [orig:90 _22 ] [90])=20 > > > (const:DI (plus:DI (symbol_ref:DI ("b") [flags 0x= 2]=20 > > > ) > > > (const_int -4 [0xfffffffffffffffc])))) [1= MEM > > > [(int *)vectp_b.12_28]+0 S64 A32]) > > >=20 > > > so instead of a masked load we see a vec_merge with a (mem:V16SI ...) > > > based on the vectp_b.12_28 pointer that has full size but the load of= b[1] > > > we try disambiguate against refers to int b[10] which is too small for > > > a load of 64 bytes so we disambiguate based on that. > >=20 > >=20 > > /* If the pointer based access is bigger than the variable they cannot > > alias. This is similar to the check below where we use TBAA to > > increase the size of the pointer based access based on the dynamic > > type of a containing object we can infer from it. */ > > poly_int64 dsize2; > > if (known_size_p (size1) --- should be unknown?? > > && poly_int_tree_p (DECL_SIZE (base2), &dsize2) > > && known_lt (dsize2, size1)) > > return false; > >=20 > > Should we set MEM_SIZE_KNOWN_P to false for maskstore/maskload? > > It seems to me maxsize should be 64bytes, but real size should be unkno= wn. >=20 > Yes, you shouldn't have MEM_ATTRs that indicate the size is known. So it looks like a generic problem and better to be handled in expand_partial_{load, store}_optab_fn?=