public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/58758] New: [4.8 REGRESSION] error: bp cannot be used in asm here
@ 2013-10-16 21:51 paulepanter at users dot sourceforge.net
  2013-10-16 21:53 ` [Bug inline-asm/58758] " pinskia at gcc dot gnu.org
  2013-10-16 21:56 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: paulepanter at users dot sourceforge.net @ 2013-10-16 21:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58758

            Bug ID: 58758
           Summary: [4.8 REGRESSION] error: bp cannot be used in asm here
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: paulepanter at users dot sourceforge.net

Starting with GCC 4.8.x, there are reports from coreboot [1] and IPXE [2] that
gcc does not compile some files previously being compiled without problems by
gcc from, for example, GCC 4.7.3.

Here are the relevant parts from coreboot’s
`src/cpu/amd/car/post_cache_as_ram.c` [3].

$ more testeb.c
#include <stdio.h>

#define CONFIG_RAMTOP 0x200000
#define CONFIG_DCACHE_RAM_BASE 0xcc000
#define CONFIG_DCACHE_RAM_SIZE 0x4000

int main(void)
{
    printf("Copying data from cache to RAM -- switching to use RAM as stack...
");

    memcopy((void *)((CONFIG_RAMTOP)-CONFIG_DCACHE_RAM_SIZE), (void
*)CONFIG_DCACHE_RAM_BASE, CONFIG_DCACHE_RAM_SIZE); //inline

    __asm__ volatile (
        /* set new esp */ /* before CONFIG_RAMBASE */
        "subl   %0, %%esp\n\t"
        ::"a"( (CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE)-
(CONFIG_RAMTOP) )
        /* discard all registers (eax is used for %0), so gcc redoes everything
           after the stack is moved */
        : "cc", "memory", "%ebx", "%ecx", "%edx", "%esi", "%edi", "%ebp"
    );
    printf("Done.\n");
}
$ gcc --verbose testeb.c
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc-4.8.real
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.8/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.8.1-10'
--with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.8 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386/jre
--enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386
--with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-targets=all --enable-multiarch --with-arch-32=i586
--with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release
--build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.8.1 (Debian 4.8.1-10) 
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i586'
 /usr/lib/gcc/i486-linux-gnu/4.8/cc1 -quiet -v -imultiarch i386-linux-gnu
testeb.c -quiet -dumpbase testeb.c -mtune=generic -march=i586 -auxbase testeb
-version -o /tmp/cc3rTPy8.s
GNU C (Debian 4.8.1-10) version 4.8.1 (i486-linux-gnu)
    compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.1-p2,
MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/i386-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/i486-linux-gnu/4.8/../../../../i486-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/i486-linux-gnu/4.8/include
 /usr/local/include
 /usr/lib/gcc/i486-linux-gnu/4.8/include-fixed
 /usr/include/i386-linux-gnu
 /usr/include
End of search list.
GNU C (Debian 4.8.1-10) version 4.8.1 (i486-linux-gnu)
    compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.1-p2,
MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 9410f42d7e8107336c1fb0157782c770
testeb.c: In function ‘main’:
testeb.c:22:1: error: bp cannot be used in asm here
 }
 ^

[1] http://review.coreboot.org/#/c/3930/
[2]
https://github.com/ipxe/ipxe/commit/238050dfd46e3c4a87329da1d48b4d8dde5af8a1
[3]
http://review.coreboot.org/gitweb?p=coreboot.git;a=blob;f=src/cpu/amd/car/post_cache_as_ram.c;h=eca7673df3ca5a579296e4d173233d9036488101;hb=HEAD#l122
>From gcc-bugs-return-431991-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Oct 16 21:52:51 2013
Return-Path: <gcc-bugs-return-431991-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24143 invoked by alias); 16 Oct 2013 21:52:51 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 24109 invoked by uid 48); 16 Oct 2013 21:52:48 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug inline-asm/58758] [4.8 REGRESSION] error: bp cannot be used in asm here
Date: Wed, 16 Oct 2013 21:52:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: inline-asm
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
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: component
Message-ID: <bug-58758-4-LhgNo3SAiI@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58758-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58758-4@http.gcc.gnu.org/bugzilla/>
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: 2013-10/txt/msg01135.txt.bz2
Content-length: 429

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX758

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |inline-asm

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
ebp is the frame pointer so it cannot be clobber by inline-asm.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug inline-asm/58758] [4.8 REGRESSION] error: bp cannot be used in asm here
  2013-10-16 21:51 [Bug c/58758] New: [4.8 REGRESSION] error: bp cannot be used in asm here paulepanter at users dot sourceforge.net
@ 2013-10-16 21:53 ` pinskia at gcc dot gnu.org
  2013-10-16 21:56 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-10-16 21:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58758

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
See also Bug 11807.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug inline-asm/58758] [4.8 REGRESSION] error: bp cannot be used in asm here
  2013-10-16 21:51 [Bug c/58758] New: [4.8 REGRESSION] error: bp cannot be used in asm here paulepanter at users dot sourceforge.net
  2013-10-16 21:53 ` [Bug inline-asm/58758] " pinskia at gcc dot gnu.org
@ 2013-10-16 21:56 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-10-16 21:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58758

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This code really should be written in pure asm rather than doing an inline-asm
as GCC can do many different optimizations more than just rereading them from
the stack.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-16 21:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-16 21:51 [Bug c/58758] New: [4.8 REGRESSION] error: bp cannot be used in asm here paulepanter at users dot sourceforge.net
2013-10-16 21:53 ` [Bug inline-asm/58758] " pinskia at gcc dot gnu.org
2013-10-16 21:56 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).