public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/52285] New: [4.7 Regression] libgcrypt _gcry_burn_stack slowdown
@ 2012-02-16 18:28 jakub at gcc dot gnu.org
  2012-02-16 18:41 ` [Bug tree-optimization/52285] " jakub at gcc dot gnu.org
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-16 18:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52285

             Bug #: 52285
           Summary: [4.7 Regression] libgcrypt _gcry_burn_stack slowdown
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org


#define wipememory2(_ptr,_set,_len) do { \
              volatile char *_vptr=(volatile char *)(_ptr); \
              unsigned long _vlen=(_len); \
              while(_vlen) { *_vptr=(_set); _vptr++; _vlen--; } \
                  } while(0)
#define wipememory(_ptr,_len) wipememory2(_ptr,0,_len)

__attribute__((noinline, noclone)) void
_gcry_burn_stack (int bytes)
{
  char buf[64];

    wipememory (buf, sizeof buf);
    bytes -= sizeof buf;
    if (bytes > 0)
        _gcry_burn_stack (bytes);
}

is one of the hot parts of gcrypt camellia256 ECB benchmark which apparently
slowed down in 4.7 compared to 4.6.  The routine is called many times, usually
with bytes equal to 372.

The above first slowed down the whole benchmark from ~ 2040ms to ~ 2400ms (-O2
-march=corei7-avx -fPIC) in
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178104
and then (somewhat surprisingly) became tiny bit faster again with
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181172 , which no longer tail
recursion optimizes the function (in this case suprisingly a win, but generally
IMHO a mistake).


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

end of thread, other threads:[~2023-07-07 10:29 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-16 18:28 [Bug tree-optimization/52285] New: [4.7 Regression] libgcrypt _gcry_burn_stack slowdown jakub at gcc dot gnu.org
2012-02-16 18:41 ` [Bug tree-optimization/52285] " jakub at gcc dot gnu.org
2012-02-16 18:47 ` jakub at gcc dot gnu.org
2012-02-16 18:53 ` jakub at gcc dot gnu.org
2012-02-16 23:07 ` jakub at gcc dot gnu.org
2012-02-20 11:20 ` jakub at gcc dot gnu.org
2012-02-20 21:46 ` [Bug middle-end/52285] " pinskia at gcc dot gnu.org
2012-02-22 10:10 ` jakub at gcc dot gnu.org
2012-03-22  9:00 ` [Bug middle-end/52285] [4.7/4.8 " rguenth at gcc dot gnu.org
2012-06-14  8:29 ` rguenth at gcc dot gnu.org
2012-09-20 10:23 ` jakub at gcc dot gnu.org
2012-11-13 10:30 ` steven at gcc dot gnu.org
2012-11-13 10:44 ` jakub at gcc dot gnu.org
2012-11-13 23:38 ` steven at gcc dot gnu.org
2013-04-11  8:00 ` [Bug middle-end/52285] [4.7/4.8/4.9 " rguenth at gcc dot gnu.org
2014-06-12 13:49 ` [Bug middle-end/52285] [4.7/4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-12-19 13:42 ` [Bug middle-end/52285] [4.8/4.9/5 " jakub at gcc dot gnu.org
2015-06-23  8:25 ` [Bug middle-end/52285] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
2015-06-26 20:17 ` [Bug middle-end/52285] [4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:38 ` jakub at gcc dot gnu.org
2021-05-14  9:46 ` [Bug middle-end/52285] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:05 ` rguenth at gcc dot gnu.org
2022-05-27  9:34 ` [Bug middle-end/52285] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:30 ` jakub at gcc dot gnu.org
2023-07-07 10:29 ` [Bug middle-end/52285] [11/12/13/14 " rguenth 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).