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/109109] [13 Regression] mariadb fails in tests on i586 (non-LTO mode) after r13-4435-g2c089640279614e3
Date: Tue, 14 Mar 2023 13:46:31 +0000	[thread overview]
Message-ID: <bug-109109-4-wR4ihKPjwZ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109109-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
More complete testcase:
unsigned int arr[64];

__attribute__((noipa, regparm (2))) unsigned long long
f1 (unsigned int ax, unsigned int dx)
{
  return (((unsigned long long) arr[ax]) << 32) | ax;
}

__attribute__((noipa, regparm (2))) unsigned long long
f2 (unsigned int ax, unsigned int dx)
{
  return (((unsigned long long) arr[dx]) << 32) | ax;
}

__attribute__((noipa, regparm (2))) unsigned long long
f3 (unsigned int ax, unsigned int dx)
{
  return (((unsigned long long) ((unsigned int *) (((char *) arr) + ax))[dx])
<< 32) | ax;
}

__attribute__((noipa, regparm (2))) unsigned long long
f4 (unsigned int ax, unsigned int dx)
{
  return (((unsigned long long) arr[ax]) << 32) | dx;
}

__attribute__((noipa, regparm (2))) unsigned long long
f5 (unsigned int ax, unsigned int dx)
{
  return (((unsigned long long) arr[dx]) << 32) | dx;
}

__attribute__((noipa, regparm (2))) unsigned long long
f6 (unsigned int ax, unsigned int dx)
{
  return (((unsigned long long) ((unsigned int *) (((char *) arr) + ax))[dx])
<< 32) | dx;
}

__attribute__((noipa, regparm (3))) unsigned long long
f7 (unsigned int ax, unsigned int dx, unsigned int cx)
{
  return (((unsigned long long) arr[ax]) << 32) | cx;
}

__attribute__((noipa, regparm (3))) unsigned long long
f8 (unsigned int ax, unsigned int dx, unsigned int cx)
{
  return (((unsigned long long) arr[dx]) << 32) | cx;
}

__attribute__((noipa, regparm (3))) unsigned long long
f9 (unsigned int ax, unsigned int dx, unsigned int cx)
{
  return (((unsigned long long) ((unsigned int *) (((char *) arr) + ax))[dx])
<< 32) | cx;
}

__attribute__((noipa, regparm (2))) unsigned long long
f10 (unsigned int ax, unsigned int dx)
{
  return (((unsigned long long) ax) << 32) | arr[ax];
}

__attribute__((noipa, regparm (2))) unsigned long long
f11 (unsigned int ax, unsigned int dx)
{
  return (((unsigned long long) ax) << 32) | arr[dx];
}

__attribute__((noipa, regparm (2))) unsigned long long
f12 (unsigned int ax, unsigned int dx)
{
  return (((unsigned long long) ax) << 32) | ((unsigned int *) (((char *) arr)
+ ax))[dx];
}

__attribute__((noipa, regparm (2))) unsigned long long
f13 (unsigned int ax, unsigned int dx)
{
  return (((unsigned long long) dx) << 32) | arr[ax];
}

__attribute__((noipa, regparm (2))) unsigned long long
f14 (unsigned int ax, unsigned int dx)
{
  return (((unsigned long long) dx) << 32) | arr[dx];
}

__attribute__((noipa, regparm (2))) unsigned long long
f15 (unsigned int ax, unsigned int dx)
{
  return (((unsigned long long) dx) << 32) | ((unsigned int *) (((char *) arr)
+ ax))[dx];
}

__attribute__((noipa, regparm (3))) unsigned long long
f16 (unsigned int ax, unsigned int dx, unsigned int cx)
{
  return (((unsigned long long) cx) << 32) | arr[ax];
}

__attribute__((noipa, regparm (3))) unsigned long long
f17 (unsigned int ax, unsigned int dx, unsigned int cx)
{
  return (((unsigned long long) cx) << 32) | arr[dx];
}

__attribute__((noipa, regparm (3))) unsigned long long
f18 (unsigned int ax, unsigned int dx, unsigned int cx)
{
  return (((unsigned long long) cx) << 32) | ((unsigned int *) (((char *) arr)
+ ax))[dx];
}

int
main ()
{
  for (int i = 0; i < 64; i++)
    arr[i] = 64 + i;
#define CHECK_EQ(x, y) do { if (x != y) __builtin_printf ("%s %llx != %llx\n",
#x, x, y); } while (0)
  CHECK_EQ (f1 (8, 9), 0x4800000008ULL);
  CHECK_EQ (f2 (8, 9), 0x4900000008ULL);
  CHECK_EQ (f3 (8, 9), 0x4b00000008ULL);
  CHECK_EQ (f4 (8, 9), 0x4800000009ULL);
  CHECK_EQ (f5 (8, 9), 0x4900000009ULL);
  CHECK_EQ (f6 (8, 9), 0x4b00000009ULL);
  CHECK_EQ (f7 (8, 9, 10), 0x480000000aULL);
  CHECK_EQ (f8 (8, 9, 10), 0x490000000aULL);
  CHECK_EQ (f9 (8, 9, 10), 0x4b0000000aULL);
  CHECK_EQ (f10 (8, 9), 0x800000048ULL);
  CHECK_EQ (f11 (8, 9), 0x800000049ULL);
  CHECK_EQ (f12 (8, 9), 0x80000004bULL);
  CHECK_EQ (f13 (8, 9), 0x900000048ULL);
  CHECK_EQ (f14 (8, 9), 0x900000049ULL);
  CHECK_EQ (f15 (8, 9), 0x90000004bULL);
  CHECK_EQ (f16 (8, 9, 10), 0xa00000048ULL);
  CHECK_EQ (f17 (8, 9, 10), 0xa00000049ULL);
  CHECK_EQ (f18 (8, 9, 10), 0xa0000004bULL);
}

This fails:
f4 (8, 9) 4800000048 != 4800000009
f6 (8, 9) 4b0000004b != 4b00000009

  parent reply	other threads:[~2023-03-14 13:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 13:53 [Bug tree-optimization/109109] New: " marxin at gcc dot gnu.org
2023-03-13 13:55 ` [Bug target/109109] [13 Regression] " rguenth at gcc dot gnu.org
2023-03-13 13:57 ` marxin at gcc dot gnu.org
2023-03-13 16:43 ` jakub at gcc dot gnu.org
2023-03-13 16:52 ` jakub at gcc dot gnu.org
2023-03-13 21:48 ` marxin at gcc dot gnu.org
2023-03-13 21:50 ` jakub at gcc dot gnu.org
2023-03-13 21:57 ` marxin at gcc dot gnu.org
2023-03-13 21:58 ` marxin at gcc dot gnu.org
2023-03-13 22:01 ` marxin at gcc dot gnu.org
2023-03-13 22:48 ` jakub at gcc dot gnu.org
2023-03-14  7:29 ` marxin at gcc dot gnu.org
2023-03-14  7:30 ` marxin at gcc dot gnu.org
2023-03-14  8:42 ` marxin at gcc dot gnu.org
2023-03-14  9:02 ` jakub at gcc dot gnu.org
2023-03-14 10:11 ` marxin at gcc dot gnu.org
2023-03-14 11:21 ` jakub at gcc dot gnu.org
2023-03-14 11:22 ` marxin at gcc dot gnu.org
2023-03-14 13:46 ` jakub at gcc dot gnu.org [this message]
2023-03-14 15:15 ` jakub at gcc dot gnu.org
2023-03-14 18:23 ` jakub at gcc dot gnu.org
2023-03-14 18:26 ` cvs-commit at gcc dot gnu.org
2023-03-14 18:27 ` marxin at gcc dot gnu.org

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-109109-4-wR4ihKPjwZ@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).