From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7F47E3857C62; Fri, 28 Aug 2020 09:23:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F47E3857C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598606638; bh=8B9t3e/BGXBfiO5mBxHUsJG7ij9roiRXobKzY4mFXqQ=; h=From:To:Subject:Date:From; b=WMC6XT/fjMmiidWgvpfJZ72YWUafjDu6QMVLMMMYIR6tpCRDmLb/4kYZW5j2PYLD8 OcZPcJTppktVMLdpo1BU46x5LcvznY1Qkx4ik6lt5oGtzJrF/Ha3Eg63ABlGGX6En2 DIq0WFWi23yrMUlzYENVGXTrwfi+kks4cABBCeXE= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/96831] New: gcc.dg/tree-ssa/scev-[345].c FAIL on i?86 and arm Date: Fri, 28 Aug 2020 09:23:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Fri, 28 Aug 2020 09:23:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96831 Bug ID: 96831 Summary: gcc.dg/tree-ssa/scev-[345].c FAIL on i?86 and arm Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- The testcases now FAIL after dumping TARGET_MEM_REF bases as &a instead of symbol: a and thus show that IVOPTs doesn't consider using a pointer IV: For lp64 (x86_64) I see : _10 =3D (sizetype) k_4(D); _8 =3D _10 * 8; _6 =3D (sizetype) k_4(D); _3 =3D _6 * 8; _2 =3D _3 + 4; _1 =3D &a + _2; ivtmp.5_7 =3D (unsigned long) _1; : # i_12 =3D PHI # ivtmp.5_5 =3D PHI _1_16 =3D (int *) ivtmp.5_5; a_p =3D _1_16; _19 =3D (void *) ivtmp.5_5; MEM[(int *)_19] =3D 100; i_9 =3D k_4(D) + i_12; ivtmp.5_11 =3D ivtmp.5_5 + _8; if (i_9 <=3D 999) so the ADDRESS use and the dereference use use the same IV. But with ilp32 we end up with : # i_12 =3D PHI _5 =3D (unsigned int) &a; _11 =3D (unsigned int) i_12; _10 =3D _11 * 8; _8 =3D _5 + _10; _7 =3D _8 + 4; _6 =3D (int *) _7; _1_16 =3D _6; a_p =3D _1_16; _3 =3D (sizetype) i_12; MEM[(int *)&a + _3 * 8] =3D 100; i_9 =3D k_4(D) + i_12; if (i_9 <=3D 999) (scev-4.c) and eventually .L2: movl $100, a+4(,%eax,8) leal a+4(,%eax,8), %ecx addl %edx, %eax cmpl $999, %eax jle .L2 movl %ecx, a_p instead of .L3: addl %edi, %ecx movl $100, (%rax) movq %rax, %rsi addq %rdx, %rax cmpl $999, %ecx jle .L3 movq %rsi, a_p(%rip) it's not entirely clear whether based on costs one is better than the other (we are not able to replace the COMPARE use and thus the tested for variant uses one more IV).=