public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/36438] New: gcc ICE compiling code with mmx builtin
@ 2008-06-05 6:37 davidxl at gcc dot gnu dot org
2008-06-05 6:42 ` [Bug rtl-optimization/36438] " davidxl at gcc dot gnu dot org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: davidxl at gcc dot gnu dot org @ 2008-06-05 6:37 UTC (permalink / raw)
To: gcc-bugs
Compiling the following code with latest compiler, got ice:
f.i: In function 'void foo(int __vector__*, int)':
f.i:33: internal compiler error: in trunc_int_for_mode, at explow.c:55
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
// f.i:
typedef unsigned short int16;
typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));
typedef long long __v1di __attribute__ ((__vector_size__ (8)));
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__,
__artificial__))
_mm_slli_si64 (__m64 __m, int __count)
{
return (__m64) __builtin_ia32_psllqi ((__v1di)__m, __count);
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__,
__artificial__))
_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0)
{
return (__m64) __builtin_ia32_vec_init_v4hi (__w0, __w1, __w2, __w3);
}
inline __m64 __attribute__((__always_inline__)) SetS16(int16 a, int16 b, int16
c, int16 d) {
return _mm_set_pi16(d, c, b, a);
}
void foo(__m64* dest, int n) {
__m64 mask = SetS16(0x00FF, 0xFF00, 0x0000, 0x00FF);
for ( int i = 0 ; i < n; ++i ) {
mask = _mm_slli_si64(mask, 8);
mask = _mm_slli_si64(mask, 8);
*dest = mask;
++dest;
}
__builtin_ia32_emms ();
}
--
Summary: gcc ICE compiling code with mmx builtin
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: davidxl at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36438
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug rtl-optimization/36438] gcc ICE compiling code with mmx builtin
2008-06-05 6:37 [Bug rtl-optimization/36438] New: gcc ICE compiling code with mmx builtin davidxl at gcc dot gnu dot org
@ 2008-06-05 6:42 ` davidxl at gcc dot gnu dot org
2008-06-05 11:22 ` ubizjak at gmail dot com
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: davidxl at gcc dot gnu dot org @ 2008-06-05 6:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from davidxl at gcc dot gnu dot org 2008-06-05 06:41 -------
cse1 (RTL) does some expression simplification on the fly such as
t = x << 4
r = t << 4
==>
r = x << 8
However for mmx shift operation, the mode (V1DI) for the const folding is
illegal -- resulting in ICE.
--
davidxl at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |davidxl at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36438
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug rtl-optimization/36438] gcc ICE compiling code with mmx builtin
2008-06-05 6:37 [Bug rtl-optimization/36438] New: gcc ICE compiling code with mmx builtin davidxl at gcc dot gnu dot org
2008-06-05 6:42 ` [Bug rtl-optimization/36438] " davidxl at gcc dot gnu dot org
@ 2008-06-05 11:22 ` ubizjak at gmail dot com
2008-06-05 11:54 ` ubizjak at gmail dot com
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2008-06-05 11:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from ubizjak at gmail dot com 2008-06-05 11:21 -------
Your testcase works for me on i686-pc-linux-gnu with 'GCC: (GNU) 4.4.0 20080605
(experimental) [trunk revision 136389]', with -mmmx and all optimization
levels:
.L5:
movq %mm1, %mm0
psllq $8, %mm0
psllq $8, %mm0
movq %mm0, (%ecx,%eax,8)
addl $1, %eax
movq %mm0, %mm1
cmpl %eax, %edx
jg .L5
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36438
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug rtl-optimization/36438] gcc ICE compiling code with mmx builtin
2008-06-05 6:37 [Bug rtl-optimization/36438] New: gcc ICE compiling code with mmx builtin davidxl at gcc dot gnu dot org
2008-06-05 6:42 ` [Bug rtl-optimization/36438] " davidxl at gcc dot gnu dot org
2008-06-05 11:22 ` ubizjak at gmail dot com
@ 2008-06-05 11:54 ` ubizjak at gmail dot com
2008-06-05 12:51 ` ubizjak at gmail dot com
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2008-06-05 11:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from ubizjak at gmail dot com 2008-06-05 11:53 -------
The bug triggers on x86_64-pc-linux-gnu target. I will look into it.
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC target triplet| |x86_64-pc-linux-gnu
Last reconfirmed|0000-00-00 00:00:00 |2008-06-05 11:53:55
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36438
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug rtl-optimization/36438] gcc ICE compiling code with mmx builtin
2008-06-05 6:37 [Bug rtl-optimization/36438] New: gcc ICE compiling code with mmx builtin davidxl at gcc dot gnu dot org
` (2 preceding siblings ...)
2008-06-05 11:54 ` ubizjak at gmail dot com
@ 2008-06-05 12:51 ` ubizjak at gmail dot com
2008-06-05 17:06 ` ubizjak at gmail dot com
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2008-06-05 12:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from ubizjak at gmail dot com 2008-06-05 12:50 -------
There is a general problem with vector shifts by scalar operands. The code
assumed that both operands are vector mode operands, so it tries to add both
constant shift operands using V1DImode.
Following patch fixes ICE:
Index: cse.c
===================================================================
--- cse.c (revision 136389)
+++ cse.c (working copy)
@@ -3489,6 +3489,11 @@ fold_rtx (rtx x, rtx insn)
&& exact_log2 (- INTVAL (const_arg1)) >= 0)))
break;
+ /* ??? Vector mode shifts by scalar
+ shift operand are not supported yet. */
+ if (is_shift && VECTOR_MODE_P (mode))
+ break;
+
if (is_shift
&& (INTVAL (inner_const) >= GET_MODE_BITSIZE (mode)
|| INTVAL (inner_const) < 0))
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |ubizjak at gmail dot com
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2008-06-05 11:53:55 |2008-06-05 12:50:18
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36438
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug rtl-optimization/36438] gcc ICE compiling code with mmx builtin
2008-06-05 6:37 [Bug rtl-optimization/36438] New: gcc ICE compiling code with mmx builtin davidxl at gcc dot gnu dot org
` (3 preceding siblings ...)
2008-06-05 12:51 ` ubizjak at gmail dot com
@ 2008-06-05 17:06 ` ubizjak at gmail dot com
2008-06-05 17:38 ` davidxl at gcc dot gnu dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2008-06-05 17:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from ubizjak at gmail dot com 2008-06-05 17:05 -------
Patch at http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00268.html
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2008-
| |06/msg00268.html
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36438
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug rtl-optimization/36438] gcc ICE compiling code with mmx builtin
2008-06-05 6:37 [Bug rtl-optimization/36438] New: gcc ICE compiling code with mmx builtin davidxl at gcc dot gnu dot org
` (4 preceding siblings ...)
2008-06-05 17:06 ` ubizjak at gmail dot com
@ 2008-06-05 17:38 ` davidxl at gcc dot gnu dot org
2008-06-06 15:07 ` uros at gcc dot gnu dot org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: davidxl at gcc dot gnu dot org @ 2008-06-05 17:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from davidxl at gcc dot gnu dot org 2008-06-05 17:37 -------
(In reply to comment #5)
> Patch at http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00268.html
>
Thanks -- same as my local workaround.
David
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36438
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug rtl-optimization/36438] gcc ICE compiling code with mmx builtin
2008-06-05 6:37 [Bug rtl-optimization/36438] New: gcc ICE compiling code with mmx builtin davidxl at gcc dot gnu dot org
` (5 preceding siblings ...)
2008-06-05 17:38 ` davidxl at gcc dot gnu dot org
@ 2008-06-06 15:07 ` uros at gcc dot gnu dot org
2008-06-06 15:09 ` ubizjak at gmail dot com
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: uros at gcc dot gnu dot org @ 2008-06-06 15:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from uros at gcc dot gnu dot org 2008-06-06 15:06 -------
Subject: Bug 36438
Author: uros
Date: Fri Jun 6 15:04:51 2008
New Revision: 136486
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136486
Log:
PR rtl-optimization/36438
* cse.c (fold_rtx) [ASHIFT, LSHIFTRT, ASHIFTRT]: Break out early
for vector shifts with constant scalar shift operands.
Added:
trunk/gcc/testsuite/gcc.target/i386/pr36438.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cse.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36438
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug rtl-optimization/36438] gcc ICE compiling code with mmx builtin
2008-06-05 6:37 [Bug rtl-optimization/36438] New: gcc ICE compiling code with mmx builtin davidxl at gcc dot gnu dot org
` (6 preceding siblings ...)
2008-06-06 15:07 ` uros at gcc dot gnu dot org
@ 2008-06-06 15:09 ` ubizjak at gmail dot com
2008-11-13 22:43 ` uros at gcc dot gnu dot org
2008-11-14 8:02 ` uros at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2008-06-06 15:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from ubizjak at gmail dot com 2008-06-06 15:08 -------
Fixed.
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36438
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug rtl-optimization/36438] gcc ICE compiling code with mmx builtin
2008-06-05 6:37 [Bug rtl-optimization/36438] New: gcc ICE compiling code with mmx builtin davidxl at gcc dot gnu dot org
` (7 preceding siblings ...)
2008-06-06 15:09 ` ubizjak at gmail dot com
@ 2008-11-13 22:43 ` uros at gcc dot gnu dot org
2008-11-14 8:02 ` uros at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: uros at gcc dot gnu dot org @ 2008-11-13 22:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from uros at gcc dot gnu dot org 2008-11-13 22:42 -------
Subject: Bug 36438
Author: uros
Date: Thu Nov 13 22:40:52 2008
New Revision: 141834
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141834
Log:
Backport from mainline:
2008-06-06 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/36438
* cse.c (fold_rtx) [ASHIFT, LSHIFTRT, ASHIFTRT]: Break out early
for vector shifts with constant scalar shift operands.
testsuite/ChangeLog:
Backport from mainline:
2008-06-06 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/36438
* gcc.target/i386/pr36438.c
Added:
branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr36438.c
Modified:
branches/gcc-4_3-branch/gcc/ChangeLog
branches/gcc-4_3-branch/gcc/cse.c
branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36438
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug rtl-optimization/36438] gcc ICE compiling code with mmx builtin
2008-06-05 6:37 [Bug rtl-optimization/36438] New: gcc ICE compiling code with mmx builtin davidxl at gcc dot gnu dot org
` (8 preceding siblings ...)
2008-11-13 22:43 ` uros at gcc dot gnu dot org
@ 2008-11-14 8:02 ` uros at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: uros at gcc dot gnu dot org @ 2008-11-14 8:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from uros at gcc dot gnu dot org 2008-11-14 08:00 -------
Subject: Bug 36438
Author: uros
Date: Fri Nov 14 07:59:33 2008
New Revision: 141849
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141849
Log:
Backport from mainline:
2008-06-06 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/36438
* cse.c (fold_rtx) [ASHIFT, LSHIFTRT, ASHIFTRT]: Break out early
for vector shifts with constant scalar shift operands.
testsuite/ChangeLog:
Backport from mainline:
2008-06-06 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/36438
* gcc.target/i386/pr36438.c
Added:
branches/gcc-4_2-branch/gcc/testsuite/gcc.target/i386/pr36438.c
- copied unchanged from r141834,
branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr36438.c
Modified:
branches/gcc-4_2-branch/gcc/ChangeLog
branches/gcc-4_2-branch/gcc/cse.c
branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36438
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-11-14 8:02 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-05 6:37 [Bug rtl-optimization/36438] New: gcc ICE compiling code with mmx builtin davidxl at gcc dot gnu dot org
2008-06-05 6:42 ` [Bug rtl-optimization/36438] " davidxl at gcc dot gnu dot org
2008-06-05 11:22 ` ubizjak at gmail dot com
2008-06-05 11:54 ` ubizjak at gmail dot com
2008-06-05 12:51 ` ubizjak at gmail dot com
2008-06-05 17:06 ` ubizjak at gmail dot com
2008-06-05 17:38 ` davidxl at gcc dot gnu dot org
2008-06-06 15:07 ` uros at gcc dot gnu dot org
2008-06-06 15:09 ` ubizjak at gmail dot com
2008-11-13 22:43 ` uros at gcc dot gnu dot org
2008-11-14 8:02 ` uros at gcc dot gnu dot org
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).