From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8321F3857824; Thu, 11 Aug 2022 09:25:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8321F3857824 From: "stefansf at linux dot ibm.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/100960] var-tracking: parameter location in subregister not tracked Date: Thu, 11 Aug 2022 09:25:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: stefansf at linux dot ibm.com 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: 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: Thu, 11 Aug 2022 09:25:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100960 --- Comment #5 from Stefan Schulze Frielinghaus --- However, I found another example (see attachment a-t2.c.325r.vartrack) which does not profit from the patch: __attribute__((noinline, noclone)) void fn1 (int x) { __asm volatile ("" : "+r" (x) : : "memory"); } __attribute__((noinline, noclone)) int fn2 (int x, int y) { if (x) { // x is copied into call-saved r11 fn1 (x); // locs of x point to entry value only // ignoring r11 fn1 (x); } return y; } __attribute__((noinline, noclone)) int fn3 (int x, int y) { return fn2 (x, y); } int main () { fn3 (36, 25); return 0; } For fn2 the value for parameter x is 5:5 cselib hash table: ... (value/u:SI 5:5 @0x5fb9420/0x5f5e600) locs: from insn 1 (value/u:SI 6:263 @0x5fb9438/0x5f5e630) from insn 1 (entry_value:SI (reg:SI 2 %r2 [ xD.2274 ])) from insn 1 (reg:SI 2 %r2 [ xD.2274 ]) no addrs which is recorded in bb 2. In bb 4 (the true branch of the if) register r2 = is saved in r11: bb 4 op 0 insn 36 MO_VAL_USE (concat/v:DI (value/u:DI 26:26 @0x5fb9618/0x5f5e9f0) (reg:DI 2 %r2 [64])) bb 4 op 1 insn 36 MO_VAL_SET (concat/u:DI (value/u:DI 26:26 @0x5fb9618/0x5f5e9f0) (set (reg/v:DI 11 %r11 [orig:61 xD.2274+-4 ] [61]) (reg:DI 2 %r2 [64]))) (insn 36 10 11 4 (set (reg/v:DI 11 %r11 [orig:61 xD.2274+-4 ] [61]) (reg:DI 2 %r2 [64])) 1472 {*movdi_64} (nil)) cselib hash table: (value/u:DI 26:26 @0x5fb9618/0x5f5e9f0) locs: from insn 36 (reg/v:DI 11 %r11 [orig:61 xD.2274+-4 ] [61]) from insn 36 (reg:DI 2 %r2 [64]) no addrs cselib preserved hash table: ... (value/u:SI 5:5 @0x5fb9420/0x5f5e600) locs: from insn 1 (value/u:SI 6:263 @0x5fb9438/0x5f5e630) from insn 1 (entry_value:SI (reg:SI 2 %r2 [ xD.2274 ])) no addrs However at bb 4 the relation between r2 and value 5:5 is lost (except the e= ntry value relation). Thus I cannot record the subvalue relation between 5:5 and 26:26 at least not during creation of 26:26. Since cselib resets its table after jumps I'm not sure how to proceed here. Any ideas? I would be also up for the second idea and pretend that the move is not a DImode copy but a SImode copy. However, I'm not sure how to look up the mod= e of the actual type. Any pointers?=