User account creation filtered due to spam.

Bug 50911 - [4.7 regression] assertion failure in expand_vec_perm_interleave2 with -msse
Summary: [4.7 regression] assertion failure in expand_vec_perm_interleave2 with -msse
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.7.0
: P1 normal
Target Milestone: 4.7.0
Assignee: Jakub Jelinek
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-10-29 15:13 UTC by Eric Botcazou
Modified: 2011-11-09 21:50 UTC (History)
1 user (show)

See Also:
Host:
Target: i?86-*-* x86_64-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-11-09 00:00:00


Attachments
Concatenated testcase (1.03 KB, text/plain)
2011-10-29 15:13 UTC, Eric Botcazou
Details
gcc47-pr50911.patch (1.24 KB, patch)
2011-11-09 18:26 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Botcazou 2011-10-29 15:13:42 UTC
Created attachment 25660 [details]
Concatenated testcase

This is a regression introduced by the recent changes in the x86 back-end which are related to vectorization.  If you compile the to-be-gnatchoped testcase with -O3 -msse, you get:

eric@atlantis:~/build/gcc> gcc -S -gnatws -O3 -msse loop_optimization9.adb
+===========================GNAT BUG DETECTED==============================+
| 4.7.0 20111028 (experimental) [trunk revision 180610] (i586-suse-linux-gnu) GCC error:|
| in expand_vec_perm_interleave2, at config/i386/i386.c:35573              |
| Error detected around gcc/ada/rts/s-string.ads:58:4              

This compiles fine with -O3 -msse2 instead.  The testcase can directly be added
to the testsuite as gnat.dg/loop_optimization9.ad[sb].
Comment 1 Jakub Jelinek 2011-11-09 13:52:58 UTC
Shorter testcase (in a language I understand ;) ):
struct A { void *a, *b; };

void
foo (struct A *p)
{
  int i;
  for (i = 0; i < 1024; i++)
    {
      p[i].a = 0;
      p[i].b = "abc";
    }
}
Comment 2 Jakub Jelinek 2011-11-09 15:01:50 UTC
Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180450
I'll have a look.
Comment 3 Jakub Jelinek 2011-11-09 18:26:12 UTC
Created attachment 25772 [details]
gcc47-pr50911.patch

Untested fix.
Comment 4 Jakub Jelinek 2011-11-09 21:37:31 UTC
Author: jakub
Date: Wed Nov  9 21:37:27 2011
New Revision: 181238

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181238
Log:
	PR target/50911
	* config/i386/i386.c (expand_vec_perm_interleave2): If d->vmode is
	V4SImode, !TARGET_SSE2 and punpck[lh]* is needed, change dremap.vmode
	to V4SFmode.

	* gcc.dg/torture/vshuf-16.inc: Add interleave low and high
	permutations.
	* gcc.dg/torture/vshuf-32.inc: Likewise.
	* gcc.dg/torture/vshuf-4.inc: Likewise.
	* gcc.dg/torture/vshuf-8.inc: Likewise.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/torture/vshuf-16.inc
    trunk/gcc/testsuite/gcc.dg/torture/vshuf-32.inc
    trunk/gcc/testsuite/gcc.dg/torture/vshuf-4.inc
    trunk/gcc/testsuite/gcc.dg/torture/vshuf-8.inc
Comment 5 Jakub Jelinek 2011-11-09 21:50:58 UTC
Fixed.