public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/39102] gcc generating multiple stack stores in optimised code
       [not found] <bug-39102-4@http.gcc.gnu.org/bugzilla/>
@ 2012-01-19  7:29 ` pinskia at gcc dot gnu.org
  2012-11-23 14:08 ` jens.maurer at gmx dot net
  1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-19  7:29 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-19
     Ever Confirmed|0                           |1
           Severity|normal                      |enhancement

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-19 06:20:02 UTC ---
Confirmed, I think this is the standard passing via registers a struct who's
mode is BLKmode.


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

* [Bug target/39102] gcc generating multiple stack stores in optimised code
       [not found] <bug-39102-4@http.gcc.gnu.org/bugzilla/>
  2012-01-19  7:29 ` [Bug target/39102] gcc generating multiple stack stores in optimised code pinskia at gcc dot gnu.org
@ 2012-11-23 14:08 ` jens.maurer at gmx dot net
  1 sibling, 0 replies; 2+ messages in thread
From: jens.maurer at gmx dot net @ 2012-11-23 14:08 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Jens Maurer <jens.maurer at gmx dot net> 2012-11-23 14:07:34 UTC ---
Here is another test case:


struct S {
  unsigned char * p;
  unsigned char * limit;
};

S g(S s);

inline __attribute__((always_inline)) S f(S s, unsigned int n);

S f(S s, unsigned int n)
{
  if (__builtin_expect(s.p + n < s.limit, 1)) {
    s.p += n;
    return s;
  }
  return g(s);
}

extern S sext;

int main()
{
  S s = sext;
  s = f(s, 4);
  s = f(s, 8);
  s = f(s, 2);
  return (int)(unsigned long)s.p;
}


leading to
        movq    %rax, (%rsp)
        movq    %rdx, 8(%rsp)
in the code paths calling g(s), although "s" is kept in registers throughout.


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

end of thread, other threads:[~2012-11-23 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-39102-4@http.gcc.gnu.org/bugzilla/>
2012-01-19  7:29 ` [Bug target/39102] gcc generating multiple stack stores in optimised code pinskia at gcc dot gnu.org
2012-11-23 14:08 ` jens.maurer at gmx dot net

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).