From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B50EC385E009; Sat, 28 Mar 2020 07:38:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B50EC385E009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1585381089; bh=WtvBMKPBQg1GDU09hypXU9X6u5CDIrnWhj/uhqUc6Xw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yC72UBrNJmmz4w03rUugDyi9jUdPoerOe8amm3BJ7ul+5yF3Zjalaqwnq6rKgvsEt fiBtjqJKhgEtc3VGY1B4DJZe1VlVh2CR7rUjTvvRI/8aM86xIJcUKw90yxKXf4xzEs YQSy2kGNqT6y2Z+P+C3XTs6ZaMHB/sMKRR+4Dkx0= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/93946] Bogus redundant store removal Date: Sat, 28 Mar 2020 07:38:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Mar 2020 07:38:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93946 --- Comment #12 from rguenther at suse dot de --- On March 27, 2020 9:19:33 PM GMT+01:00, "sandra at gcc dot gnu.org" wrote: >https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93946 > >--- Comment #11 from sandra at gcc dot gnu.org --- >RTL before sched2 does look sane and similar to that generated for x86 >with >-m32. > >I've been trying to step through sched2. I think that where things get >interesting is the call to true_dependence at sched-deps.c:2663. > >Breakpoint 6, true_dependence (mem=3D0x7ffff742c9a8, mem_mode=3DE_VOIDmode, > > x=3D0x7ffff742cac8) > at /scratch/sandra/nios2-elf-fsf/src/gcc-mainline/gcc/alias.c:3056 >3056 return true_dependence_1 (mem, mem_mode, NULL_RTX, >(gdb) print debug_rtx(mem) >(mem/j:SI (reg/v/f:SI 5 r5 [orig:48 ptr ] [48]) [1 MEM[(struct aa >*)ptr_1(D)].a.u.i+0 S4 A32]) >$19 =3D void >(gdb) print debug_rtx(x) >(mem/j:SI (reg/v/f:SI 4 r4 [orig:47 bv ] [47]) [1 bv_3(D)->b.u.f+0 S4 >A32]) >$20 =3D void > >This is making it all the way to the end of true_dependence_1, into >rtx_refs_may_alias_p, and into refs_may_alias_p_1, which is returning >false, >which gets propagated back up as the result of true_dependence. IIUC, >this is >what is allowing sched2 to move the read from "x" ahead of the write to >"mem". > >Before I spend more time on this, am I on the right track here? And is >this >pointing at the problem being in refs_may_alias_p_1 rather than >somewhere along >the way e.g. in true_dependence_1? Those are two stores, right? Then true_dependence is the wrong predicate to look at it should be output_dependence instead.=