* [Bug middle-end/59471] [4.9 Regression] ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR)
2013-12-11 15:28 [Bug tree-optimization/59471] New: ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR) jgreenhalgh at gcc dot gnu.org
@ 2013-12-13 10:54 ` rguenth at gcc dot gnu.org
2013-12-17 9:48 ` jakub at gcc dot gnu.org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-13 10:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59471
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-12-13
Component|tree-optimization |middle-end
Version|unknown |4.9.0
Target Milestone|--- |4.9.0
Summary|ICE using vector extensions |[4.9 Regression] ICE using
|(non-top-level |vector extensions
|BIT_FIELD_REF, |(non-top-level
|IMAGPART_EXPR or |BIT_FIELD_REF,
|REALPART_EXPR) |IMAGPART_EXPR or
| |REALPART_EXPR)
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/59471] [4.9 Regression] ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR)
2013-12-11 15:28 [Bug tree-optimization/59471] New: ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR) jgreenhalgh at gcc dot gnu.org
2013-12-13 10:54 ` [Bug middle-end/59471] [4.9 Regression] " rguenth at gcc dot gnu.org
@ 2013-12-17 9:48 ` jakub at gcc dot gnu.org
2013-12-17 20:54 ` glisse at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-12-17 9:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59471
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think BIT_FIELD_REF's type can't be a vector, so it has to be integral type
in this case.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/59471] [4.9 Regression] ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR)
2013-12-11 15:28 [Bug tree-optimization/59471] New: ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR) jgreenhalgh at gcc dot gnu.org
2013-12-13 10:54 ` [Bug middle-end/59471] [4.9 Regression] " rguenth at gcc dot gnu.org
2013-12-17 9:48 ` jakub at gcc dot gnu.org
@ 2013-12-17 20:54 ` glisse at gcc dot gnu.org
2013-12-17 20:56 ` jakub at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-12-17 20:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59471
--- Comment #5 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> I think BIT_FIELD_REF's type can't be a vector,
Er, I am quite sure a BIT_FIELD_REF can be a vector. Maybe that wasn't a
general statement and I missed the context?
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/59471] [4.9 Regression] ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR)
2013-12-11 15:28 [Bug tree-optimization/59471] New: ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR) jgreenhalgh at gcc dot gnu.org
` (2 preceding siblings ...)
2013-12-17 20:54 ` glisse at gcc dot gnu.org
@ 2013-12-17 20:56 ` jakub at gcc dot gnu.org
2013-12-17 21:10 ` glisse at gcc dot gnu.org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-12-17 20:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59471
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
You mean BIT_FIELD_REF argument can be a vector? Sure. But the type of the
BIT_FIELD_REF itself?
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/59471] [4.9 Regression] ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR)
2013-12-11 15:28 [Bug tree-optimization/59471] New: ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR) jgreenhalgh at gcc dot gnu.org
` (3 preceding siblings ...)
2013-12-17 20:56 ` jakub at gcc dot gnu.org
@ 2013-12-17 21:10 ` glisse at gcc dot gnu.org
2013-12-19 13:04 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-12-17 21:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59471
--- Comment #7 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #6)
> You mean BIT_FIELD_REF argument can be a vector? Sure. But the type of the
> BIT_FIELD_REF itself?
Yes, the type of the BIT_FIELD_REF itself. A quick grep gives:
t = build3 (BIT_FIELD_REF, vectype, new_temp,
in tree-vect-stmts.c where I assume vectype is a vector type. IIRC,
tree-vect-generic.c also produces plenty of those when lowering extra-long
vectors.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/59471] [4.9 Regression] ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR)
2013-12-11 15:28 [Bug tree-optimization/59471] New: ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR) jgreenhalgh at gcc dot gnu.org
` (4 preceding siblings ...)
2013-12-17 21:10 ` glisse at gcc dot gnu.org
@ 2013-12-19 13:04 ` rguenth at gcc dot gnu.org
2013-12-19 13:04 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-19 13:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59471
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
If nobody beats me to it I'll take care of the gimplify.c piece after holidays.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/59471] [4.9 Regression] ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR)
2013-12-11 15:28 [Bug tree-optimization/59471] New: ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR) jgreenhalgh at gcc dot gnu.org
` (5 preceding siblings ...)
2013-12-19 13:04 ` rguenth at gcc dot gnu.org
@ 2013-12-19 13:04 ` rguenth at gcc dot gnu.org
2013-12-19 13:05 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-19 13:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59471
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
The reason I added this verification is that code does not expect those to
appear at non-outermost handled-component. a V_C_E around a vector type
B_F_R should have been split into two different stmts with a temporary.
Eventually gimplification doesn't ensure this (and thus force_gimple_operand
and friends may generate invalid gimple).
So the fix probably has a piece in gimplify.c at least - make sure
is_gimple_reg_type () B_F_R, RP_E, IP_E get a temporary.
RP_E and IP_E are probably safe as complex types are quite constrained.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/59471] [4.9 Regression] ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR)
2013-12-11 15:28 [Bug tree-optimization/59471] New: ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR) jgreenhalgh at gcc dot gnu.org
` (6 preceding siblings ...)
2013-12-19 13:04 ` rguenth at gcc dot gnu.org
@ 2013-12-19 13:05 ` rguenth at gcc dot gnu.org
2013-12-20 14:26 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-19 13:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59471
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/59471] [4.9 Regression] ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR)
2013-12-11 15:28 [Bug tree-optimization/59471] New: ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR) jgreenhalgh at gcc dot gnu.org
` (7 preceding siblings ...)
2013-12-19 13:05 ` rguenth at gcc dot gnu.org
@ 2013-12-20 14:26 ` rguenth at gcc dot gnu.org
2014-01-08 8:59 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-20 14:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59471
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
Testing
Index: gimplify.c
===================================================================
--- gimplify.c (revision 205891)
+++ gimplify.c (working copy)
@@ -7358,12 +7358,22 @@ gimplify_expr (tree *expr_p, gimple_seq
TREE_TYPE (*expr_p));
break;
+ case VIEW_CONVERT_EXPR:
+ if (is_gimple_reg_type (TREE_TYPE (*expr_p))
+ && is_gimple_reg_type (TREE_TYPE (TREE_OPERAND (*expr_p, 0))))
+ {
+ ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
+ post_p, is_gimple_val, fb_rvalue);
+ recalculate_side_effects (*expr_p);
+ break;
+ }
+ /* Fallthru. */
+
case ARRAY_REF:
case ARRAY_RANGE_REF:
case REALPART_EXPR:
case IMAGPART_EXPR:
case COMPONENT_REF:
- case VIEW_CONVERT_EXPR:
ret = gimplify_compound_lval (expr_p, pre_p, post_p,
fallback ? fallback : fb_rvalue);
break;
@@ -7709,10 +7719,17 @@ gimplify_expr (tree *expr_p, gimple_seq
break;
case BIT_FIELD_REF:
- ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
- post_p, is_gimple_lvalue, fb_either);
- recalculate_side_effects (*expr_p);
- break;
+ {
+ if (is_gimple_reg_type (TREE_TYPE (*expr_p))
+ && is_gimple_reg_type (TREE_TYPE (TREE_OPERAND (*expr_p, 0))))
+ ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
+ post_p, is_gimple_val, fb_rvalue);
+ else
+ ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
+ post_p, is_gimple_lvalue, fb_either);
+ recalculate_side_effects (*expr_p);
+ break;
+ }
case TARGET_MEM_REF:
{
code-generation for the testcase is awkward though:
foo:
.LFB0:
.cfi_startproc
movaps %xmm0, -24(%rsp)
movq -24(%rsp), %rax
movq %rax, -24(%rsp)
movq -24(%rsp), %xmm0
ret
not sure why RTL cannot recover here, we expand from
foo (uint16x8_t x)
{
vector(2) long unsigned int _2;
long unsigned int _3;
uint8x8_t _4;
<bb 2>:
_2 = VIEW_CONVERT_EXPR<vector(2) long unsigned int>(x_5(D));
_3 = BIT_FIELD_REF <_2, 64, 0>;
_4 = VIEW_CONVERT_EXPR<uint8x8_t>(_3);
return _4;
with forwprop we could re-write this into
_4 = BIT_FIELD_REF <x_5(D), 64, 0>;
as BIT_FIELD_REF is allowed to select uint8x8_t from uint16x8_t directly.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/59471] [4.9 Regression] ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR)
2013-12-11 15:28 [Bug tree-optimization/59471] New: ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR) jgreenhalgh at gcc dot gnu.org
` (8 preceding siblings ...)
2013-12-20 14:26 ` rguenth at gcc dot gnu.org
@ 2014-01-08 8:59 ` rguenth at gcc dot gnu.org
2014-01-08 9:00 ` rguenth at gcc dot gnu.org
2014-01-08 22:33 ` jakub at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-08 8:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59471
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Wed Jan 8 08:59:29 2014
New Revision: 206420
URL: http://gcc.gnu.org/viewcvs?rev=206420&root=gcc&view=rev
Log:
2014-01-08 Richard Biener <rguenther@suse.de>
PR middle-end/59471
* gimplify.c (gimplify_expr): Gimplify register-register type
VIEW_CONVERT_EXPRs to separate stmts.
* gcc.dg/pr59471.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.dg/pr59471.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimplify.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/59471] [4.9 Regression] ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR)
2013-12-11 15:28 [Bug tree-optimization/59471] New: ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR) jgreenhalgh at gcc dot gnu.org
` (9 preceding siblings ...)
2014-01-08 8:59 ` rguenth at gcc dot gnu.org
@ 2014-01-08 9:00 ` rguenth at gcc dot gnu.org
2014-01-08 22:33 ` jakub at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-08 9:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59471
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/59471] [4.9 Regression] ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR)
2013-12-11 15:28 [Bug tree-optimization/59471] New: ICE using vector extensions (non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR) jgreenhalgh at gcc dot gnu.org
` (10 preceding siblings ...)
2014-01-08 9:00 ` rguenth at gcc dot gnu.org
@ 2014-01-08 22:33 ` jakub at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-01-08 22:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59471
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Jan 8 22:33:12 2014
New Revision: 206448
URL: http://gcc.gnu.org/viewcvs?rev=206448&root=gcc&view=rev
Log:
PR middle-end/59471
* gcc.dg/pr59471.c (foo): Avoid vector type arguments or return
type, use pointers to vector type instead.
Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/pr59471.c
^ permalink raw reply [flat|nested] 13+ messages in thread