Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/include Declare some asm statement with output...



details:   https://anonhg.NetBSD.org/src/rev/7ab57b6c97a4
branches:  trunk
changeset: 518438:7ab57b6c97a4
user:      enami <enami%NetBSD.org@localhost>
date:      Fri Nov 30 06:53:56 2001 +0000

description:
Declare some asm statement with output as volatile.  Without this,
gcc with -march=pentiumpro produce bad code.

diffstat:

 sys/arch/i386/include/profile.h |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (24 lines):

diff -r 259b25d6498e -r 7ab57b6c97a4 sys/arch/i386/include/profile.h
--- a/sys/arch/i386/include/profile.h   Fri Nov 30 06:40:52 2001 +0000
+++ b/sys/arch/i386/include/profile.h   Fri Nov 30 06:53:56 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: profile.h,v 1.15 2001/08/23 06:17:00 chs Exp $ */
+/*     $NetBSD: profile.h,v 1.16 2001/11/30 06:53:56 enami Exp $       */
 
 /*
  * Copyright (c) 1992, 1993
@@ -58,11 +58,12 @@
         *                                                              \
         * selfpc = pc pushed by mcount call                            \
         */                                                             \
-       __asm__("movl 4(%%ebp),%0" : "=r" (selfpc));                    \
+       __asm__ __volatile__("movl 4(%%ebp),%0" : "=r" (selfpc));       \
        /*                                                              \
         * frompcindex = pc pushed by call into self.                   \
         */                                                             \
-       __asm__("movl (%%ebp),%0;movl 4(%0),%0" : "=r" (frompcindex));  \
+       __asm__ __volatile__("movl (%%ebp),%0;movl 4(%0),%0"            \
+           : "=r" (frompcindex));                                      \
        _mcount((u_long)frompcindex, (u_long)selfpc);                   \
 }
 



Home | Main Index | Thread Index | Old Index