From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 146953889808; Tue, 13 Jul 2021 14:36:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 146953889808 From: "andrey.vihrov at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug inline-asm/101438] New: Compiler hang on inline asm with local register and VLA operands Date: Tue, 13 Jul 2021 14:36:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: inline-asm X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: andrey.vihrov at gmail dot 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone cf_gcctarget 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: Tue, 13 Jul 2021 14:36:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101438 Bug ID: 101438 Summary: Compiler hang on inline asm with local register and VLA operands Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: inline-asm Assignee: unassigned at gcc dot gnu.org Reporter: andrey.vihrov at gmail dot com Target Milestone: --- Target: x86_64-pc-linux-gnu Compiling this C source: int main(void) { register long long rax __asm__("rax") =3D 0; register long long rbx __asm__("rbx") =3D 0; register long long rcx __asm__("rcx") =3D 0; register long long rdx __asm__("rdx") =3D 0; register long long rsi __asm__("rsi") =3D 0; register long long rdi __asm__("rdi") =3D 0; register long long r8 __asm__("r8") =3D 0; register long long r9 __asm__("r9") =3D 0; register long long r10 __asm__("r10") =3D 0; register long long r11 __asm__("r11") =3D 0; register long long r12 __asm__("r12") =3D 0; register long long r13 __asm__("r13") =3D 0; register long long r14 __asm__("r14") =3D 0; register long long r15 __asm__("r15") =3D 0; volatile int x =3D 1; char arr[x]; __asm__ ("" : : "r"(rax), "r"(rbx), "r"(rcx), "r"(rdx), "r"(rsi), "r"(rdi), "r"(r8), "r"(r9), "r"(r10), "r"(r11), "r"(r12), "r"(r13), "r"(r14), "r"(r15), "m"(arr) ); } with "gcc -O1 test.c" causes the compiler to hang in an infinite loop. Note: This code could possibly be formally incorrect, as [1] warns about potential clobbering after initialization of local register variables.=20 [1] https://gcc.gnu.org/onlinedocs/gcc/Local-Register-Variables.html=