From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5922A3858D32; Sat, 18 Nov 2023 16:13:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5922A3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700324014; bh=wp6zfNIHthQdE0CSKMFdiOj5dTV0J+4gCO6XRMy3nOY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kfipiGVSXZz8ikArIBjVLNe5lMlBMOiaIBawwAsmehDmh6Ay47EIit4rVARiXVoMD Xb59IahVABRgaJxrsMmNNhnO8kbSwUvrOcHQzoOhnEJHAjELE1fiIOjsPp60MyuXrY 6z/iVQNUFBp3g+MShHNEyxTu68bHrtIF1pBjbM/w= From: "jakub at jermar dot eu" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/112604] [ia64] Output register not preserved after a branch is not taken Date: Sat, 18 Nov 2023 16:13:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at jermar dot eu 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: attachments.created 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=3D112604 --- Comment #3 from Jakub Jermar --- Created attachment 56633 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D56633&action=3Dedit Updated requested good object file for vfs_file.c Seems like -O3 -fno-unswitch-loops makes the bug go away. See the new attachment for a better example of the good binary and the object file. With this optimization disabled the argument for the malloc/calloc is set only a= fter the branch is taken so it does not destroy the argument for fibril_mutex_unlock(): 4000000000001a00 <_vfs_fd_alloc>: 4000000000001a00: 08 48 3d 1a 80 05 [MMI] alloc r41=3Dar.pfs,15,13,0 4000000000001a06: d0 02 80 00 42 60 mov r45=3Dr32 4000000000001a0c: 05 00 cc 00 mov r43=3Dpr 4000000000001a10: 09 38 01 41 00 21 [MMI] adds r39=3D64,r= 32 4000000000001a16: a0 02 04 00 42 40 mov r42=3Dr1 4000000000001a1c: 04 10 41 00 zxt1 r34=3Dr34;; 4000000000001a20: 11 80 00 44 91 39 [MIB] cmp4.eq p16,p17=3D0,r34 4000000000001a26: 80 02 00 62 00 00 mov r40=3Db0 4000000000001a2c: 68 b2 01 50 br.call.sptk.ma= ny b0=3D400000000001cc80 ;; 4000000000001a30: 08 68 01 40 00 21 [MMI] mov r45=3Dr32 4000000000001a36: 44 02 00 00 42 20 (p16) mov r36=3Dr0 4000000000001a3c: 00 50 01 84 mov r1=3Dr42 4000000000001a40: 09 70 00 4e 18 10 [MMI] ld8 r14=3D[r39] 4000000000001a46: 54 02 00 00 42 c0 (p16) mov r37=3Dr0 4000000000001a4c: 15 00 00 90 mov r46=3D1;; 4000000000001a50: 38 22 e1 01 07 64 [MMB] (p17) mov r36=3D1016 4000000000001a56: 54 fa 03 00 48 00 (p17) mov r37=3D127 4000000000001a5c: 00 00 00 20 nop.b 0x0 4000000000001a60: 11 38 00 1c 06 39 [MIB] cmp.eq p7,p6=3D= 0,r14 4000000000001a66: c0 02 04 65 80 03 mov.i r44=3Dar.= lc 4000000000001a6c: f0 03 00 43 (p07) br.cond.dpnt.few 4000000000001e50 <_vfs_fd_alloc+0x450>;; 4000000000001a70: 10 00 00 00 01 00 [MIB] nop.m 0x0 4000000000001a76: 00 00 00 02 00 00 nop.i 0x0 4000000000001a7c: 10 00 00 40 br.few 4000000000001a80 <_vfs_fd_alloc+0x80> 4000000000001a80: 11 00 00 00 01 00 [MIB] nop.m 0x0 4000000000001a86: 00 00 00 02 00 00 nop.i 0x0 4000000000001a8c: 88 b7 01 50 br.call.sptk.ma= ny b0=3D400000000001d200 ;; 4000000000001a90: 11 68 01 40 00 21 [MIB] mov r45=3Dr32 .... 4000000000001e50: 11 68 01 00 08 24 [MIB] mov r45=3D1024 4000000000001e56: 00 00 00 02 00 00 nop.i 0x0 4000000000001e5c: f8 bd 00 50 br.call.sptk.ma= ny b0=3D400000000000dc40 ;; ....=