From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 498A2386F46B; Thu, 7 May 2020 15:59:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 498A2386F46B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588867186; bh=f4GU6v+thhYkK/jTai1z2/4kegVy4i5B79it0mg0YXE=; h=From:To:Subject:Date:From; b=o7GyslYyqQACSu1Iivqf+PV2Y9p9eZ4fUaFHsbLaoNCM0XsygXMYGTuNKSyuejgEK H1ZmHvatb/pLZihNagEs6mc2MHwQ+4myZqH1jdJ2sXQBuO0fMFQ6Mi89aggvIT+YCI qcSEKO23bRPOkev4QqzUX8k2k92pBv8qvJGMpftc= From: "arnd at linaro dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/94986] New: missing diagnostic on ARM thumb2 compilation with -pg when using r7 in inline asm Date: Thu, 07 May 2020 15:59:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: arnd at linaro dot 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: Thu, 07 May 2020 15:59:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94986 Bug ID: 94986 Summary: missing diagnostic on ARM thumb2 compilation with -pg when using r7 in inline asm Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: arnd at linaro dot org Target Milestone: --- I reported a bug against clang for a Linux kernel failure, but=20 it was suggested that the clang behavior is probably correct in this corner case while gcc gets it wrong, see https://bugs.llvm.org/show_bug.cgi?id=3D4= 5826 echo 'void f(void) { asm("mov r7, #0" ::: "r7"); }' | arm-linux-gnueabi-gcc -march=3Darmv7-a -O2 -mthumb -pg -S -xc - silently accepts an inline asm statement that clobbers the frame pointer, b= ut gcc rejects the same code if any of '-O0', '-fomit-frame-pointer' or 'fno-omit-frame-pointer' are used: : In function 'f': :1:44: error: r7 cannot be used in 'asm' here If using r7 in this case is indeed invalid, we need to ensure the kernel do= es not do this, and having gcc reject it would be helpful.=