This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/4744] New: _mcount should not clobber flags


The source for mcount [sysdeps/i386/i386-mcount.S] claims that it must not
clobber any register:

/* We need a special version of the `mcount' function since for ix86 it
   must not clobber any register.  This has several reasons:

However, there is the problem, because _mcount clobbers flags. There is a case,
where gcc schedules insns to produce following code during optimized build [1]:

.LCFI5:
        cmpl    $9, __cp_log_handling_MOD_stack_pointer(%rip)
        call    mcount
        jle     .L6

So, it is obvious that wrong results are produced in case mcount clobbers flags. 

[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32450

-- 
           Summary: _mcount should not clobber flags
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: ubizjak at gmail dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: i686-linux-gnu
  GCC host triplet: i686-linux-gnu
GCC target triplet: i686-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=4744

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]