public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jens.maurer at gmx dot net" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/39102] gcc generating multiple stack stores in optimised code Date: Fri, 23 Nov 2012 14:08:00 -0000 [thread overview] Message-ID: <bug-39102-4-BOBZITCbYg@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-39102-4@http.gcc.gnu.org/bugzilla/> 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.
prev parent reply other threads:[~2012-11-23 14:08 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top [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 [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-39102-4-BOBZITCbYg@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).