diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2003-03-16 22:12:01 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2003-03-16 22:12:01 +0000 |
commit | dcbe33d83aeca1d70ee00142b9a624dc1205b4b4 (patch) | |
tree | aa00e763d3777f0924e8a05a88e36e7fc038bd24 /winsup/mingw/profile | |
parent | 7729cf524f54a2e8ab15cf4eb5c5667136534783 (diff) | |
download | cygnal-dcbe33d83aeca1d70ee00142b9a624dc1205b4b4.tar.gz cygnal-dcbe33d83aeca1d70ee00142b9a624dc1205b4b4.tar.bz2 cygnal-dcbe33d83aeca1d70ee00142b9a624dc1205b4b4.zip |
* profile/profile.h (mcount): Use __builtin_return_address
rather than __asm statements.
* profile/Makefile.in: Remove special rule for mcount.o
Specify dependencies for mcount.o profil.o gmon.o.
Diffstat (limited to 'winsup/mingw/profile')
-rw-r--r-- | winsup/mingw/profile/Makefile.in | 11 | ||||
-rw-r--r-- | winsup/mingw/profile/profile.h | 8 |
2 files changed, 12 insertions, 7 deletions
diff --git a/winsup/mingw/profile/Makefile.in b/winsup/mingw/profile/Makefile.in index f18bfe44a..aca3a2950 100644 --- a/winsup/mingw/profile/Makefile.in +++ b/winsup/mingw/profile/Makefile.in @@ -89,10 +89,12 @@ gcrt1.o: gcrt0.c gcrt2.o: gcrt0.c $(CC) -D__MSVCRT__ -c -o $@ $(CPPFLAGS) $(CFLAGS) $? -#FIXME: Optimizing at higher than -O1 tweaks a bug in gcc 3.2.2 -# and earlier -mcount.o: mcount.c - $(CC) -D__MSVCRT__ -c -o $@ $(CPPFLAGS) ${filter-out -O%,$(ALL_CFLAGS)} -O1 $? +# +# Dependancies +# +gmon.o: gmon.c gmon.h profile.h profil.h +mcount.o: mcount.c gmon.h profile.h +profil.o: profil.c profil.h Makefile: Makefile.in config.status configure $(SHELL) config.status @@ -137,3 +139,4 @@ dist: @for i in $(DISTFILES); do\ cp -p $(srcdir)/$$i $(distdir)/profile/$$i ; \ done + diff --git a/winsup/mingw/profile/profile.h b/winsup/mingw/profile/profile.h index d578657f8..6c198d742 100644 --- a/winsup/mingw/profile/profile.h +++ b/winsup/mingw/profile/profile.h @@ -46,18 +46,20 @@ void \ mcount() \ { \ - int selfpc, frompcindex; \ + u_long selfpc, frompcindex; \ /* \ * find the return address for mcount, \ * and the return address for mcount's caller. \ * \ * selfpc = pc pushed by mcount call \ */ \ - __asm("movl 4(%%ebp),%0" : "=r" (selfpc)); \ + /* __asm volatile ("movl 4(%%ebp),%0" : "=r" (selfpc)); */ \ + selfpc = (u_long) __builtin_return_address (0); \ /* \ * frompcindex = pc pushed by call into self. \ */ \ - __asm("movl (%%ebp),%0;movl 4(%0),%0" : "=r" (frompcindex)); \ + /* __asm ("movl (%%ebp),%0;movl 4(%0),%0" : "=r" (frompcindex)); */ \ + frompcindex = (u_long) __builtin_return_address (1); \ _mcount(frompcindex, selfpc); \ } |