From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29772 invoked by alias); 15 Oct 2014 05:57:03 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 29750 invoked by uid 48); 15 Oct 2014 05:57:00 -0000 From: "vinitha_kv at rediffmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug inline-asm/63541] New: gcc compilation error: The register specified for 'variable' is not general enough to be used as a register variable Date: Wed, 15 Oct 2014 05:57:00 -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: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vinitha_kv at rediffmail dot com X-Bugzilla-Status: UNCONFIRMED 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 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-10/txt/msg01112.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63541 Bug ID: 63541 Summary: gcc compilation error: The register specified for 'variable' is not general enough to be used as a register variable Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: inline-asm Assignee: unassigned at gcc dot gnu.org Reporter: vinitha_kv at rediffmail dot com For the following code gcc throws error and do not compile (for arm-*-gnueabi*) Test code: $ cat test.c void foo() { register unsigned int curr_pc asm ("pc"); unsigned int arm_pc; arm_pc = curr_pc; } Observed the issue with gcc-4.8.0 onwards.(Works fine with 4.7.2) Checked with latest with gcc 5.0 (GNU C (GCC) version 5.0.0 20141014 ) also, getting the following error. ... xgcc -v Using built-in specs. COLLECT_GCC=~/gcc-git/official-gcc/objdir/gcc/xgcc Target: arm-none-linux-gnueabi Configured with: ../configure --host=x86_64-pc-linux-gnu --target=arm-none-linux-gnueabi --build=x86_64-pc-linux-gnu --prefix=/usr/local/arm-none-linux-gnueabi/cross --disable-nls --enable-__cxa_atexit --enable-languages=c,c++ --disable-multilib --enable-threads=posix --enable-shared --enable-symvers=gnu Thread model: posix gcc version 5.0.0 20141014 (experimental) (GCC) ... test.c: In function 'foo': test.c:3:24: error: the register specified for 'curr_pc' is not general enough to be used as a register variable register unsigned int curr_pc asm ("pc"); ... Digged a little and the error seems to occur after commit, [https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=bffbb863ff0f267b5111bfa95b42c99cd0474424] in 4.8.0. Regards, Vinitha Vijayan