public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/101023] [11/12 Regression] wrong code with -mstackrealign
Date: Fri, 11 Jun 2021 12:56:00 +0000	[thread overview]
Message-ID: <bug-101023-4-qHZUTihRly@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101023-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Here it is:

// PR target/101023
// { dg-do run }
// { dg-options "-O2 -mtune=opteron -mstackrealign
--param=hot-bb-frequency-fraction=1" }

struct S {
  __attribute__((noipa)) int m1 ();
  __attribute__((noipa)) void m2 ();
};
struct T {
  __attribute__((noipa)) virtual S m3 ();
};
struct U : T {
  int u;
  __attribute__((noipa)) U (int);
};
int *a;
S *b;
int c;

int
S::m1 ()
{
  return 0;
}

void
S::m2 ()
{
}

S
T::m3 ()
{
  return S ();
}

U::U (int) : u (4)
{
}

__attribute__((noipa)) int
foo ()
{
  if (a)
    return 0;
  U d(c);
  S *e = b;
  e->m2 ();
  return e->m1();
}

int
main ()
{
  register int r12 __asm ("r12") = 1;
  register int rax __asm ("rax") = 2;
  asm volatile ("" : "+r" (r12), "+r" (rax));
  foo ();
  asm volatile ("" : "+r" (r12));
  if (r12 != 1)
    __builtin_abort ();
}

  parent reply	other threads:[~2021-06-11 12:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 21:13 [Bug target/101023] New: " zsojka at seznam dot cz
2021-06-11  8:03 ` [Bug target/101023] " rguenth at gcc dot gnu.org
2021-06-11  8:19 ` ubizjak at gmail dot com
2021-06-11 12:25 ` hjl.tools at gmail dot com
2021-06-11 12:56 ` jakub at gcc dot gnu.org [this message]
2021-06-11 12:56 ` jakub at gcc dot gnu.org
2021-06-11 13:09 ` zsojka at seznam dot cz
2021-06-11 14:37 ` hjl.tools at gmail dot com
2021-06-11 20:49 ` hjl.tools at gmail dot com
2021-06-13 12:16 ` cvs-commit at gcc dot gnu.org
2021-06-13 13:16 ` hjl.tools at gmail dot com
2021-07-15 12:43 ` cvs-commit at gcc dot gnu.org
2021-07-15 12:43 ` hjl.tools at gmail dot com

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-101023-4-qHZUTihRly@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).