------- Comment #10 from jrgn dot keil at googlemail dot com 2010-04-04 19:02 ------- (In reply to comment #6) > I found none of the changes to internal_mcount to be necessary: with the > attached > patch, I could both bootstrap mainline successfully on i386-pc-solaris2.11, > the > -pg related testsuite failures were gone, and I could profile a small test > program > with gcc -pg -m64.
Hmm, what about the part in the suggested patch from comment 2 that fixed restoring the %rcx register; lines 275,7 in gmon-sol2.c ? Without that change a 64bit compiled profiled function destroys the contents of the %rdx parameter and might corrupt %rcx: gmon-sol2.c: 260 "\tmovq\t%rax,(%rsp)\n" 261 "\tmovq\t%rcx,0x08(%rsp)\n" 262 "\tmovq\t%rdx,0x10(%rsp)\n" ... 277 "\tmovq\t0x10(%rsp),%rdx\n" 278 "\tmovq\t0x08(%rsp),%rdx\n" <<<<<<<<<<<<<< 279 "\tmovq\t(%rsp),%rax\n" Line 278 must restore to %rcx ! This should still be broken. -- jrgn dot keil at googlemail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jrgn dot keil at googlemail | |dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38085