public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/66887] New: trunk/libmpx/mpxrt/mpxrt.c:158: possible performance problem
@ 2015-07-15 18:24 dcb314 at hotmail dot com
  2015-09-24  8:53 ` [Bug other/66887] " dcb314 at hotmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dcb314 at hotmail dot com @ 2015-07-15 18:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66887

            Bug ID: 66887
           Summary: trunk/libmpx/mpxrt/mpxrt.c:158: possible performance
                    problem
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

[trunk/libmpx/mpxrt/mpxrt.c:159]: (performance) Buffer 'buffer' is being
written before its old content has been used.

Source code is

  memset (buffer, 0, sizeof (buffer));
  memcpy (buffer,
      (uint8_t *)uctxt->uc_mcontext.fpregs + XSAVE_OFFSET_IN_FPMEM,
      sizeof (struct xsave_struct));

Maybe something like

  memcpy (buffer,
      (uint8_t *)uctxt->uc_mcontext.fpregs + XSAVE_OFFSET_IN_FPMEM,
      sizeof (struct xsave_struct));

  memset (&buffer[sizeof (struct xsave_struct))], 0, sizeof (buffer) - sizeof
(struct xsave_struct)) );


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

* [Bug other/66887] trunk/libmpx/mpxrt/mpxrt.c:158: possible performance problem
  2015-07-15 18:24 [Bug other/66887] New: trunk/libmpx/mpxrt/mpxrt.c:158: possible performance problem dcb314 at hotmail dot com
@ 2015-09-24  8:53 ` dcb314 at hotmail dot com
  2015-09-24 10:02 ` ienkovich at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: dcb314 at hotmail dot com @ 2015-09-24  8:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66887

--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
sizeof (struct xsave_struct) is about 900 bytes, so there is plenty of time
to be saved.


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

* [Bug other/66887] trunk/libmpx/mpxrt/mpxrt.c:158: possible performance problem
  2015-07-15 18:24 [Bug other/66887] New: trunk/libmpx/mpxrt/mpxrt.c:158: possible performance problem dcb314 at hotmail dot com
  2015-09-24  8:53 ` [Bug other/66887] " dcb314 at hotmail dot com
@ 2015-09-24 10:02 ` ienkovich at gcc dot gnu.org
  2015-10-15  9:27 ` ienkovich at gcc dot gnu.org
  2015-10-15  9:30 ` ienkovich at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ienkovich at gcc dot gnu.org @ 2015-09-24 10:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66887

Ilya Enkovich <ienkovich at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-09-24
                 CC|                            |ienkovich at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |ienkovich at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Ilya Enkovich <ienkovich at gcc dot gnu.org> ---
(In reply to David Binderman from comment #1)
> sizeof (struct xsave_struct) is about 900 bytes, so there is plenty of time
> to be saved.

Thanks for pointing at this.  Actually I don't see my we have both memset and
memcpy here.  Structure is copied just to return its field.  I'll fix it.


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

* [Bug other/66887] trunk/libmpx/mpxrt/mpxrt.c:158: possible performance problem
  2015-07-15 18:24 [Bug other/66887] New: trunk/libmpx/mpxrt/mpxrt.c:158: possible performance problem dcb314 at hotmail dot com
  2015-09-24  8:53 ` [Bug other/66887] " dcb314 at hotmail dot com
  2015-09-24 10:02 ` ienkovich at gcc dot gnu.org
@ 2015-10-15  9:27 ` ienkovich at gcc dot gnu.org
  2015-10-15  9:30 ` ienkovich at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ienkovich at gcc dot gnu.org @ 2015-10-15  9:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66887

--- Comment #3 from Ilya Enkovich <ienkovich at gcc dot gnu.org> ---
Author: ienkovich
Date: Thu Oct 15 09:26:39 2015
New Revision: 228838

URL: https://gcc.gnu.org/viewcvs?rev=228838&root=gcc&view=rev
Log:
libmpx/

        PR other/66887
        * mpxrt/mpxrt.c (read_mpx_status_sig): Remove useless code.


Modified:
    trunk/libmpx/ChangeLog
    trunk/libmpx/mpxrt/mpxrt.c


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

* [Bug other/66887] trunk/libmpx/mpxrt/mpxrt.c:158: possible performance problem
  2015-07-15 18:24 [Bug other/66887] New: trunk/libmpx/mpxrt/mpxrt.c:158: possible performance problem dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2015-10-15  9:27 ` ienkovich at gcc dot gnu.org
@ 2015-10-15  9:30 ` ienkovich at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ienkovich at gcc dot gnu.org @ 2015-10-15  9:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66887

Ilya Enkovich <ienkovich at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Ilya Enkovich <ienkovich at gcc dot gnu.org> ---
Fixed


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

end of thread, other threads:[~2015-10-15  9:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-15 18:24 [Bug other/66887] New: trunk/libmpx/mpxrt/mpxrt.c:158: possible performance problem dcb314 at hotmail dot com
2015-09-24  8:53 ` [Bug other/66887] " dcb314 at hotmail dot com
2015-09-24 10:02 ` ienkovich at gcc dot gnu.org
2015-10-15  9:27 ` ienkovich at gcc dot gnu.org
2015-10-15  9:30 ` ienkovich 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).