* [Bug target/52407] sse2 simd uint32_t and int64_t and stack variable initialization
2012-02-27 21:17 [Bug c/52407] New: sse2 simd uint32_t and int64_t and stack variable initialization pcpa at mandriva dot com.br
@ 2012-02-28 0:14 ` ubizjak at gmail dot com
2012-02-28 10:43 ` rguenth at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ubizjak at gmail dot com @ 2012-02-28 0:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52407
--- Comment #1 from Uros Bizjak <ubizjak at gmail dot com> 2012-02-27 23:34:33 UTC ---
This looks like an aliasing violation to me:
vl_t w;
int64_t *p = (int64_t *)&w;
p[0] = p[1] = x;
Using following code, the test works OK:
union {
vl_t w;
int64_t p[2];
} z;
z.p[0] = z.p[1] = x;
while (m--)
*u++ = *v++ * z.w;
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/52407] sse2 simd uint32_t and int64_t and stack variable initialization
2012-02-27 21:17 [Bug c/52407] New: sse2 simd uint32_t and int64_t and stack variable initialization pcpa at mandriva dot com.br
2012-02-28 0:14 ` [Bug target/52407] " ubizjak at gmail dot com
@ 2012-02-28 10:43 ` rguenth at gcc dot gnu.org
2012-02-28 11:35 ` rguenth at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-28 10:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52407
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-02-28
CC| |jakub at gcc dot gnu.org,
| |rguenth at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-28 10:39:53 UTC ---
It looks like a bug in the way we expand the vector init:
;; MEM[(int64_t *)&w + 8B] = 2;
(insn 39 38 40 (set (reg:DI 102)
(const_int 2 [0x2])) t.c:19 -1
(nil))
(insn 40 39 41 (set (reg:DI 103)
(vec_select:DI (reg/v:V2DI 98 [ w ])
(parallel [
(const_int 0 [0])
]))) t.c:19 -1
(nil))
(insn 41 40 0 (set (reg/v:V2DI 98 [ w ])
(vec_concat:V2DI (reg:DI 102)
(reg:DI 103))) t.c:19 -1
(nil))
^^^ should be vec_concat 103 102
;; MEM[(int64_t *)&w] = 2;
(insn 42 41 43 (set (reg:DI 104)
(const_int 2 [0x2])) t.c:19 -1
(nil))
(insn 43 42 44 (set (reg:DI 105)
(vec_select:DI (reg/v:V2DI 98 [ w ])
(parallel [
(const_int 1 [0x1])
]))) t.c:19 -1
(nil))
(insn 44 43 0 (set (reg/v:V2DI 98 [ w ])
(vec_concat:V2DI (reg:DI 105)
(reg:DI 104))) t.c:19 -1
(nil))
^^^ should be vec_concat 104 105
no?
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/52407] sse2 simd uint32_t and int64_t and stack variable initialization
2012-02-27 21:17 [Bug c/52407] New: sse2 simd uint32_t and int64_t and stack variable initialization pcpa at mandriva dot com.br
2012-02-28 0:14 ` [Bug target/52407] " ubizjak at gmail dot com
2012-02-28 10:43 ` rguenth at gcc dot gnu.org
@ 2012-02-28 11:35 ` rguenth at gcc dot gnu.org
2012-02-28 11:39 ` rguenth at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-28 11:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52407
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |x86_64-*-*
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-28 11:32:34 UTC ---
Hmm,
ix86_expand_vector_set
has for the V2DI case
ix86_expand_vector_extract (false, tmp, target, 1 - elt);
if (elt == 0)
tmp = gen_rtx_VEC_CONCAT (mode, tmp, val);
else
tmp = gen_rtx_VEC_CONCAT (mode, val, tmp);
vs. for the V2DF case:
tmp = gen_rtx_VEC_SELECT (inner_mode, target, tmp);
if (elt == 0)
op0 = val, op1 = tmp;
else
op0 = tmp, op1 = val;
tmp = gen_rtx_VEC_CONCAT (mode, op0, op1);
looks the V2DI case has swapped operands.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/52407] sse2 simd uint32_t and int64_t and stack variable initialization
2012-02-27 21:17 [Bug c/52407] New: sse2 simd uint32_t and int64_t and stack variable initialization pcpa at mandriva dot com.br
` (2 preceding siblings ...)
2012-02-28 11:35 ` rguenth at gcc dot gnu.org
@ 2012-02-28 11:39 ` rguenth at gcc dot gnu.org
2012-02-28 11:45 ` [Bug target/52407] [4.7 Regression] " rguenth at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-28 11:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52407
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org
|gnu.org |
--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-28 11:34:36 UTC ---
I'm testing a patch. The V2DF/SImode case is also bogus.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/52407] [4.7 Regression] sse2 simd uint32_t and int64_t and stack variable initialization
2012-02-27 21:17 [Bug c/52407] New: sse2 simd uint32_t and int64_t and stack variable initialization pcpa at mandriva dot com.br
` (3 preceding siblings ...)
2012-02-28 11:39 ` rguenth at gcc dot gnu.org
@ 2012-02-28 11:45 ` rguenth at gcc dot gnu.org
2012-02-28 12:16 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-28 11:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52407
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.6.2
Target Milestone|--- |4.7.0
Summary|sse2 simd uint32_t and |[4.7 Regression] sse2 simd
|int64_t and stack variable |uint32_t and int64_t and
|initialization |stack variable
| |initialization
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/52407] [4.7 Regression] sse2 simd uint32_t and int64_t and stack variable initialization
2012-02-27 21:17 [Bug c/52407] New: sse2 simd uint32_t and int64_t and stack variable initialization pcpa at mandriva dot com.br
` (4 preceding siblings ...)
2012-02-28 11:45 ` [Bug target/52407] [4.7 Regression] " rguenth at gcc dot gnu.org
@ 2012-02-28 12:16 ` jakub at gcc dot gnu.org
2012-02-28 15:30 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-28 12:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52407
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-28 12:02:18 UTC ---
Triggered by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184435
Testcase:
/* PR target/52407 */
extern void abort (void);
typedef long long V __attribute__ ((vector_size (16)));
V ul[4], vl[4] = { {1, 2}, {3, 4}, {5, 6}, {7, 8} };
static void
foo (V *u, V *v, long long x, int m)
{
V w;
long long *p = (long long *) &w;
p[0] = p[1] = x;
while (m--)
*u++ = *v++ * w;
}
int
main ()
{
int i;
long long *pl;
pl = (long long *) &ul;
foo (ul, vl, 2, 4);
for (i = 0; i < 8; i++)
if (pl[i] != 2 * (i + 1))
abort ();
return 0;
}
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/52407] [4.7 Regression] sse2 simd uint32_t and int64_t and stack variable initialization
2012-02-27 21:17 [Bug c/52407] New: sse2 simd uint32_t and int64_t and stack variable initialization pcpa at mandriva dot com.br
` (5 preceding siblings ...)
2012-02-28 12:16 ` jakub at gcc dot gnu.org
@ 2012-02-28 15:30 ` rguenth at gcc dot gnu.org
2012-02-28 15:36 ` [Bug target/52407] [4.6 " rguenth at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-28 15:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52407
--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-28 15:28:39 UTC ---
Author: rguenth
Date: Tue Feb 28 15:28:32 2012
New Revision: 184627
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184627
Log:
2012-02-28 Richard Guenther <rguenther@suse.de>
PR target/52407
* config/i386/i386.c (ix86_expand_vector_set): Fix element
ordering for the VEC_CONCAT for two element vectors for
V2SFmode, V2SImode and V2DImode.
* gcc.dg/torture/pr52407.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.dg/torture/pr52407.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/52407] [4.6 Regression] sse2 simd uint32_t and int64_t and stack variable initialization
2012-02-27 21:17 [Bug c/52407] New: sse2 simd uint32_t and int64_t and stack variable initialization pcpa at mandriva dot com.br
` (6 preceding siblings ...)
2012-02-28 15:30 ` rguenth at gcc dot gnu.org
@ 2012-02-28 15:36 ` rguenth at gcc dot gnu.org
2012-02-28 18:11 ` jamborm at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-28 15:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52407
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.7.0
Target Milestone|4.7.0 |4.6.4
Summary|[4.7 Regression] sse2 simd |[4.6 Regression] sse2 simd
|uint32_t and int64_t and |uint32_t and int64_t and
|stack variable |stack variable
|initialization |initialization
--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-28 15:29:53 UTC ---
Fixed on trunk. I'll backport it for 4.6.4 as it is latent on the branches.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/52407] [4.6 Regression] sse2 simd uint32_t and int64_t and stack variable initialization
2012-02-27 21:17 [Bug c/52407] New: sse2 simd uint32_t and int64_t and stack variable initialization pcpa at mandriva dot com.br
` (7 preceding siblings ...)
2012-02-28 15:36 ` [Bug target/52407] [4.6 " rguenth at gcc dot gnu.org
@ 2012-02-28 18:11 ` jamborm at gcc dot gnu.org
2012-02-29 18:30 ` pcpa at mandriva dot com.br
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jamborm at gcc dot gnu.org @ 2012-02-28 18:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52407
Martin Jambor <jamborm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jamborm at gcc dot gnu.org
--- Comment #8 from Martin Jambor <jamborm at gcc dot gnu.org> 2012-02-28 18:09:48 UTC ---
*** Bug 52419 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/52407] [4.6 Regression] sse2 simd uint32_t and int64_t and stack variable initialization
2012-02-27 21:17 [Bug c/52407] New: sse2 simd uint32_t and int64_t and stack variable initialization pcpa at mandriva dot com.br
` (8 preceding siblings ...)
2012-02-28 18:11 ` jamborm at gcc dot gnu.org
@ 2012-02-29 18:30 ` pcpa at mandriva dot com.br
2012-03-01 9:54 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pcpa at mandriva dot com.br @ 2012-02-29 18:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52407
Paulo César Pereira de Andrade <pcpa at mandriva dot com.br> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #9 from Paulo César Pereira de Andrade <pcpa at mandriva dot com.br> 2012-02-29 17:54:34 UTC ---
(In reply to comment #7)
> Fixed on trunk. I'll backport it for 4.6.4 as it is latent on the branches.
Thanks. I reported the problem because I thought it could
hit somewhere else and I have some code that way, that was
working since gcc 4.4, but the proper syntax to initialize
the local variable should be, in the sample test case:
vl_t w = {x,x};
what should make it easier for the compiler to understand
what is being done.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/52407] [4.6 Regression] sse2 simd uint32_t and int64_t and stack variable initialization
2012-02-27 21:17 [Bug c/52407] New: sse2 simd uint32_t and int64_t and stack variable initialization pcpa at mandriva dot com.br
` (9 preceding siblings ...)
2012-02-29 18:30 ` pcpa at mandriva dot com.br
@ 2012-03-01 9:54 ` rguenth at gcc dot gnu.org
2012-05-22 10:04 ` rguenth at gcc dot gnu.org
2012-05-22 10:12 ` rguenth at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-03-01 9:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52407
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-01 09:53:46 UTC ---
Re-open so I don't forget about the backporting.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/52407] [4.6 Regression] sse2 simd uint32_t and int64_t and stack variable initialization
2012-02-27 21:17 [Bug c/52407] New: sse2 simd uint32_t and int64_t and stack variable initialization pcpa at mandriva dot com.br
` (10 preceding siblings ...)
2012-03-01 9:54 ` rguenth at gcc dot gnu.org
@ 2012-05-22 10:04 ` rguenth at gcc dot gnu.org
2012-05-22 10:12 ` rguenth at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-22 10:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52407
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
--- Comment #12 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-22 09:20:41 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/52407] [4.6 Regression] sse2 simd uint32_t and int64_t and stack variable initialization
2012-02-27 21:17 [Bug c/52407] New: sse2 simd uint32_t and int64_t and stack variable initialization pcpa at mandriva dot com.br
` (11 preceding siblings ...)
2012-05-22 10:04 ` rguenth at gcc dot gnu.org
@ 2012-05-22 10:12 ` rguenth at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-22 10:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52407
--- Comment #11 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-22 09:20:24 UTC ---
Author: rguenth
Date: Tue May 22 09:20:15 2012
New Revision: 187763
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187763
Log:
2012-05-22 Richard Guenther <rguenther@suse.de>
Backport from mainline
2012-02-28 Richard Guenther <rguenther@suse.de>
PR target/52407
* config/i386/i386.c (ix86_expand_vector_set): Fix element
ordering for the VEC_CONCAT for two element vectors for
V2SFmode, V2SImode and V2DImode.
* gcc.dg/torture/pr52407.c: New testcase.
Added:
branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/torture/pr52407.c
Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/config/i386/i386.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 14+ messages in thread