public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zeccav at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/57896] ICE in in expand_expr_real_2
Date: Tue, 16 Jul 2013 06:19:00 -0000	[thread overview]
Message-ID: <bug-57896-4-XkLFJGgW3k@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57896-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Vittorio Zecca <zeccav at gmail dot com> ---
The following is a shorter version of Marc's test case:

__get_cpuid_max (unsigned int __ext, unsigned int *__sig) {
  unsigned __edx;
  __cpuid (0, 0, 0, 0, __edx);
}
int __get_cpuid (unsigned int __level, unsigned int *__eax, unsigned int
*__ebx, unsigned int *__ecx, unsigned int *__edx) {
fail: return 0;
}
typedef int IV __attribute__((vector_size(16)));
typedef union {
  int s;
  IV v;
} U;
static U i[2], b, c;
void check0(void) {
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  4, 0, 0, 0});
  (memcmp (&b, &c, sizeof(c)) == 0) || (__builtin_trap (), 0);
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  5, 0, 0, 0});
  (memcmp (&b, &c, sizeof(c)) == 0) || (__builtin_trap (), 0);
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  6, 0, 0, 0});
  (memcmp (&b, &c, sizeof(c)) == 0) || (__builtin_trap (), 0);
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  7, 0, 0, 0});
  (memcmp (&b, &c, sizeof(c)) == 0) || (__builtin_trap (), 0);
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  4, 1, 0, 0});
  (memcmp (&b, &c, sizeof(c)) == 0) || (__builtin_trap (), 0);
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  5, 1, 0, 0});
  (memcmp (&b, &c, sizeof(c)) == 0) || (__builtin_trap (), 0);
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  6, 1, 0, 0});
  (memcmp (&b, &c, sizeof(c)) == 0) || (__builtin_trap (), 0);
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  7, 1, 0, 0});
  (memcmp (&b, &c, sizeof(c)) == 0) || (__builtin_trap (), 0);
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 4, 0, 0});
  (memcmp (&b, &c, sizeof(c)) == 0) || (__builtin_trap (), 0);
}
void check2(void) {
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 0, 4, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 0, 4, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  4, 0, 4, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  5, 0, 4, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 1, 4, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 1, 4, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  4, 1, 4, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  5, 1, 4, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 0, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 0, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  4, 0, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  5, 0, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 1, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 1, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  4, 1, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  5, 1, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 4, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 4, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  4, 4, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  5, 4, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 5, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 5, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  4, 5, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  5, 5, 5, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 0, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 0, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  6, 0, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  7, 0, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 1, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 1, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  6, 1, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  7, 1, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 6, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 6, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  6, 6, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  7, 6, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 7, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 7, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  6, 7, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  7, 7, 6, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 0, 7, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 0, 7, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  6, 0, 7, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  7, 0, 7, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 1, 7, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 1, 7, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  6, 1, 7, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  7, 1, 7, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 6, 7, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 6, 7, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  6, 6, 7, 0});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  4, 3, 4, 4});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  5, 3, 4, 4});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 4, 4, 4});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 4, 4, 4});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  2, 4, 4, 4});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  3, 4, 4, 4});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  0, 5, 4, 4});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  1, 5, 4, 4});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  2, 5, 4, 4});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  3, 5, 4, 4});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  4, 0, 5, 4});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  5, 0, 5, 4});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  4, 1, 5, 4});
  b.v = __builtin_shuffle (i[0].v, i[1].v, (IV){  5, 1, 5, 4});
}

As an aside, in gcc 4.8.1 source code, before line 6995 of gcc/expr.c I put

printf("\nexpr.c:6995 value->code=%d NUM_RTX_CODE=%d\n",(int)
value->code,NUM_RTX_CODE);
gcc_assert((int) value->code < NUM_RTX_CODE);

and I get an ICE there because value->code is 34816 and NUM_RTX_CODE is 145

Indeed at line 6995 ARITHMETIC_P (value) accesses rtx_class[(int) value->code]
but the array rtx_class has only NUM_RTX_CODE elements.
However, I do not know how this is relevant to this issue.


  parent reply	other threads:[~2013-07-16  6:19 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-15  6:44 [Bug c/57896] New: " zeccav at gmail dot com
2013-07-15  9:37 ` [Bug c/57896] " mikpe at it dot uu.se
2013-07-15 14:23 ` mikpe at it dot uu.se
2013-07-15 15:32 ` glisse at gcc dot gnu.org
2013-07-15 16:32 ` glisse at gcc dot gnu.org
2013-07-15 23:42 ` zeccav at gmail dot com
2013-07-16  6:19 ` zeccav at gmail dot com [this message]
2014-02-19  8:11 ` [Bug c/57896] [4.8 Regression] ICE " mpolacek at gcc dot gnu.org
2014-02-19 17:59 ` [Bug target/57896] " ubizjak at gmail dot com
2014-02-19 18:06 ` ubizjak at gmail dot com
2014-02-19 18:34 ` ubizjak at gmail dot com
2014-02-19 18:37 ` [Bug middle-end/57896] " ubizjak at gmail dot com
2014-02-19 19:19 ` mpolacek at gcc dot gnu.org
2014-02-20  9:29 ` ubizjak at gmail dot com
2014-02-20  9:58 ` ubizjak at gmail dot com
2014-02-20 10:15 ` ubizjak at gmail dot com
2014-02-20 10:27 ` [Bug target/57896] " jakub at gcc dot gnu.org
2014-02-20 10:41 ` jakub at gcc dot gnu.org
2014-02-20 10:45 ` ubizjak at gmail dot com
2014-02-20 10:57 ` jakub at gcc dot gnu.org
2014-02-20 11:01 ` ubizjak at gmail dot com
2014-02-20 11:07 ` [Bug target/57896] [4.7/4.8/4.9 " ubizjak at gmail dot com
2014-02-20 11:42 ` jakub at gcc dot gnu.org
2014-02-20 12:00 ` jakub at gcc dot gnu.org
2014-02-20 12:09 ` ubizjak at gmail dot com
2014-02-20 13:00 ` jakub at gcc dot gnu.org
2014-02-20 13:12 ` ubizjak at gmail dot com
2014-02-20 17:25 ` ubizjak at gmail dot com
2014-02-20 20:40 ` jakub at gcc dot gnu.org
2014-02-20 20:41 ` jakub at gcc dot gnu.org
2014-02-20 20:42 ` [Bug target/57896] [4.7 " jakub at gcc dot gnu.org
2014-02-21  7:56 ` uros at gcc dot gnu.org
2014-02-21  8:01 ` ubizjak 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-57896-4-XkLFJGgW3k@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).