public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/61904] Incorrect stack red-zoning on x86-64 code generation
Date: Sat, 26 Jul 2014 10:02:00 -0000	[thread overview]
Message-ID: <bug-61904-4-4lsmWgezXv@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61904-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Here's a small (auto-)reduced testcase for this specific issue:

markus@x4 ~ % cat fair.i
int a, b, d;
enum cpu_idle_type
{
  CPU_MAX_IDLE_TYPES
};
struct sched_domain
{
  int balance_interval;
  int lb_count[0];
  int lb_nobusyg[];
} c,*g ;
__typeof__(int[0]) f;
int *h;
static struct sched_domain *fn1 (int *p1, int *p2)
{
  struct sched_domain *e;
  int i;
  for (; i = fn2 (i);)
    {
      e = &*(
               {

                 __asm__("" : "=r"(d) : "0"(0));
                 (typeof(&c))0 + a;

               });
      fn3 ();
      fn4 (i);
    }
  return e;
}

fn5 (int p1, struct sched_domain *p2, enum cpu_idle_type p3)
{
  int *j = *(
               {
                 long k;
                 asm volatile("" : "=r"(k) : ""(b), "0"(&f));
                 (typeof(*&f) *)k;
               });
  if (p3)
    h = 0;
  int l = *j;
  p2->lb_count[p3]++;
redo:
  p2->lb_nobusyg[p3]++;
  g = fn1 (0, 0);
  if (fn6 (j))
    goto redo;
  p2->balance_interval *= 2;
}

markus@x4 ~ % gcc -c -mcmodel=kernel -Os -fno-omit-frame-pointer
-fcompare-debug fair.i
gcc: error: fair.i: -fcompare-debug failure (length)
markus@x4 ~ % gcc -c -mcmodel=kernel -O2 -fno-omit-frame-pointer
-fcompare-debug fair.i
markus@x4 ~ %


      parent reply	other threads:[~2014-07-26 10:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25  8:09 [Bug c/61904] New: " torvalds@linux-foundation.org
2014-07-25  8:11 ` [Bug c/61904] " torvalds@linux-foundation.org
2014-07-25  8:17 ` [Bug target/61904] " trippels at gcc dot gnu.org
2014-07-25  8:18 ` torvalds@linux-foundation.org
2014-07-25  8:24 ` torvalds@linux-foundation.org
2014-07-25  9:27 ` rguenth at gcc dot gnu.org
2014-07-25  9:33 ` rguenth at gcc dot gnu.org
2014-07-25 18:12 ` torvalds@linux-foundation.org
2014-07-25 18:19 ` torvalds@linux-foundation.org
2014-07-25 18:42 ` pinskia at gcc dot gnu.org
2014-07-25 19:01 ` torvalds@linux-foundation.org
2014-07-26 10:02 ` trippels at gcc dot gnu.org [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-61904-4-4lsmWgezXv@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: link
Be 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).