* [Bug c++/65409] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
@ 2015-03-12 18:44 ` mpolacek at gcc dot gnu.org
2015-03-12 19:33 ` [Bug c++/65409] [4.8/4.9/5 Regression] " jakub at gcc dot gnu.org
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-12 18:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-03-12
CC| |mpolacek at gcc dot gnu.org
Target Milestone|--- |4.8.5
Ever confirmed|0 |1
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
The backtrace looks the same as in PR64744, but this ICE is reproducible even
on x86_64.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
2015-03-12 18:44 ` [Bug c++/65409] " mpolacek at gcc dot gnu.org
@ 2015-03-12 19:33 ` jakub at gcc dot gnu.org
2015-03-13 9:24 ` [Bug middle-end/65409] " rguenth at gcc dot gnu.org
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-12 19:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
Summary|ICE in store_field |[4.8/4.9/5 Regression] ICE
| |in store_field
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r191302.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
2015-03-12 18:44 ` [Bug c++/65409] " mpolacek at gcc dot gnu.org
2015-03-12 19:33 ` [Bug c++/65409] [4.8/4.9/5 Regression] " jakub at gcc dot gnu.org
@ 2015-03-13 9:24 ` rguenth at gcc dot gnu.org
2015-03-13 10:31 ` ebotcazou at gcc dot gnu.org
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-13 9:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Priority|P3 |P2
CC| |ebotcazou at gcc dot gnu.org
Component|c++ |middle-end
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
` (2 preceding siblings ...)
2015-03-13 9:24 ` [Bug middle-end/65409] " rguenth at gcc dot gnu.org
@ 2015-03-13 10:31 ` ebotcazou at gcc dot gnu.org
2015-03-13 10:37 ` jakub at gcc dot gnu.org
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-03-13 10:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC|ebotcazou at gcc dot gnu.org |
Assignee|unassigned at gcc dot gnu.org |ebotcazou at gcc dot gnu.org
--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Fixing.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
` (3 preceding siblings ...)
2015-03-13 10:31 ` ebotcazou at gcc dot gnu.org
@ 2015-03-13 10:37 ` jakub at gcc dot gnu.org
2015-03-13 10:43 ` ebotcazou at gcc dot gnu.org
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-13 10:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I've so far came up with:
--- gcc/expr.c.jj 2015-01-19 09:31:15.000000000 +0100
+++ gcc/expr.c 2015-03-13 11:30:25.699805379 +0100
@@ -6656,14 +6656,18 @@ store_field (rtx target, HOST_WIDE_INT b
&& (bitpos % BITS_PER_UNIT) == 0
&& (bitsize % BITS_PER_UNIT) == 0)))
{
- gcc_assert (MEM_P (target) && MEM_P (temp)
+ gcc_assert (MEM_P (target)
+ && (MEM_P (temp) || GET_CODE (temp) == PARALLEL)
&& (bitpos % BITS_PER_UNIT) == 0);
target = adjust_address (target, VOIDmode, bitpos / BITS_PER_UNIT);
- emit_block_move (target, temp,
- GEN_INT ((bitsize + BITS_PER_UNIT - 1)
- / BITS_PER_UNIT),
- BLOCK_OP_NORMAL);
+ HOST_WIDE_INT bytesize
+ = (bitsize + BITS_PER_UNIT - 1) / BITS_PER_UNIT;
+ if (GET_CODE (temp) == PARALLEL)
+ emit_group_store (target, temp, TREE_TYPE (exp), bytesize);
+ else
+ emit_block_move (target, temp, GEN_INT (bytesize),
+ BLOCK_OP_NORMAL);
return const0_rtx;
}
which seems to DTRT in this case.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
` (4 preceding siblings ...)
2015-03-13 10:37 ` jakub at gcc dot gnu.org
@ 2015-03-13 10:43 ` ebotcazou at gcc dot gnu.org
2015-03-13 10:46 ` jakub at gcc dot gnu.org
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-03-13 10:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
This looks redundant to me, the following is sufficient:
Index: expr.c
===================================================================
--- expr.c (revision 221407)
+++ expr.c (working copy)
@@ -6645,11 +6645,12 @@ store_field (rtx target, HOST_WIDE_INT b
&& mode != TYPE_MODE (TREE_TYPE (exp)))
temp = convert_modes (mode, TYPE_MODE (TREE_TYPE (exp)), temp, 1);
- /* If the modes of TEMP and TARGET are both BLKmode, both
- must be in memory and BITPOS must be aligned on a byte
- boundary. If so, we simply do a block copy. Likewise
- for a BLKmode-like TARGET. */
- if (GET_MODE (temp) == BLKmode
+ /* If TEMP is not a PARALLEL (see below) and its mode and that of TARGET
+ are both BLKmode, both must be in memory and BITPOS must be aligned
+ on a byte boundary. If so, we simply do a block copy. Likewise for
+ a BLKmode-like TARGET. */
+ if (GET_CODE (temp) != PARALLEL
+ && GET_MODE (temp) == BLKmode
&& (GET_MODE (target) == BLKmode
|| (MEM_P (target)
&& GET_MODE_CLASS (GET_MODE (target)) == MODE_INT
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
` (5 preceding siblings ...)
2015-03-13 10:43 ` ebotcazou at gcc dot gnu.org
@ 2015-03-13 10:46 ` jakub at gcc dot gnu.org
2015-03-13 10:53 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-13 10:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Doesn't it generate worse code though? I mean, for BLKmode PARALLEL, forcing
it into some very wide pseudo (TImode in this case, perhaps OImode for even
larger ones?) and then storing might be more expensive than what my patch does.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
` (6 preceding siblings ...)
2015-03-13 10:46 ` jakub at gcc dot gnu.org
@ 2015-03-13 10:53 ` jakub at gcc dot gnu.org
2015-03-13 10:57 ` ebotcazou at gcc dot gnu.org
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-13 10:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Ok, the pessimization (your patch vs. my patch) is only at -O0:
+ movl %edx, %ecx
+ movl %ecx, %esi
+ movq %rdx, %rdi
+ movabsq $-4294967296, %rcx
+ andq %rdi, %rcx
+ orq %rsi, %rcx
+ movq %rcx, %rdx
is added, for -O1+ the optimizers manage to fix it up.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
` (7 preceding siblings ...)
2015-03-13 10:53 ` jakub at gcc dot gnu.org
@ 2015-03-13 10:57 ` ebotcazou at gcc dot gnu.org
2015-03-13 10:59 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-03-13 10:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
--- Comment #8 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
The difference is that we go through a pseudo with my version, but the code is
optimal at -O1:
call _Z8copy_foo3Foo
movq %rax, a(%rip)
movb %dl, a+8(%rip)
and the change looks safe enough for all the branches.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
` (8 preceding siblings ...)
2015-03-13 10:57 ` ebotcazou at gcc dot gnu.org
@ 2015-03-13 10:59 ` jakub at gcc dot gnu.org
2015-03-13 17:46 ` ebotcazou at gcc dot gnu.org
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-13 10:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I agree for 4.8/4.9 that your version is safer.
Anyway, you're the RTL maintainer, so I'll let you decide.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
` (9 preceding siblings ...)
2015-03-13 10:59 ` jakub at gcc dot gnu.org
@ 2015-03-13 17:46 ` ebotcazou at gcc dot gnu.org
2015-03-16 10:27 ` ebotcazou at gcc dot gnu.org
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-03-13 17:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
--- Comment #10 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> I agree for 4.8/4.9 that your version is safer.
> Anyway, you're the RTL maintainer, so I'll let you decide.
OK, testing went fine, so I'll go for this version on all branches.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
` (10 preceding siblings ...)
2015-03-13 17:46 ` ebotcazou at gcc dot gnu.org
@ 2015-03-16 10:27 ` ebotcazou at gcc dot gnu.org
2015-03-16 10:29 ` ebotcazou at gcc dot gnu.org
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-03-16 10:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
--- Comment #11 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Author: ebotcazou
Date: Mon Mar 16 10:26:28 2015
New Revision: 221453
URL: https://gcc.gnu.org/viewcvs?rev=221453&root=gcc&view=rev
Log:
PR middle-end/65409
* expr.c (store_field): Do not do a direct block copy if the source is
a PARALLEL with BLKmode.
Added:
trunk/gcc/testsuite/g++.dg/pr65049.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/expr.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
` (11 preceding siblings ...)
2015-03-16 10:27 ` ebotcazou at gcc dot gnu.org
@ 2015-03-16 10:29 ` ebotcazou at gcc dot gnu.org
2015-03-16 10:31 ` ebotcazou at gcc dot gnu.org
2015-03-16 10:32 ` ebotcazou at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-03-16 10:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
--- Comment #12 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Author: ebotcazou
Date: Mon Mar 16 10:28:39 2015
New Revision: 221454
URL: https://gcc.gnu.org/viewcvs?rev=221454&root=gcc&view=rev
Log:
PR middle-end/65409
* expr.c (store_field): Do not do a direct block copy if the source is
a PARALLEL with BLKmode.
Added:
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/pr65049.C
- copied unchanged from r221453, trunk/gcc/testsuite/g++.dg/pr65049.C
Modified:
branches/gcc-4_9-branch/gcc/ChangeLog
branches/gcc-4_9-branch/gcc/expr.c
branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
` (12 preceding siblings ...)
2015-03-16 10:29 ` ebotcazou at gcc dot gnu.org
@ 2015-03-16 10:31 ` ebotcazou at gcc dot gnu.org
2015-03-16 10:32 ` ebotcazou at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-03-16 10:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
--- Comment #13 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Author: ebotcazou
Date: Mon Mar 16 10:30:29 2015
New Revision: 221456
URL: https://gcc.gnu.org/viewcvs?rev=221456&root=gcc&view=rev
Log:
PR middle-end/65409
* expr.c (store_field): Do not do a direct block copy if the source is
a PARALLEL with BLKmode.
Added:
branches/gcc-4_8-branch/gcc/testsuite/g++.dg/pr65049.C
- copied unchanged from r221454, trunk/gcc/testsuite/g++.dg/pr65049.C
Modified:
branches/gcc-4_8-branch/gcc/ChangeLog
branches/gcc-4_8-branch/gcc/expr.c
branches/gcc-4_8-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/65409] [4.8/4.9/5 Regression] ICE in store_field
2015-03-12 18:17 [Bug c++/65409] New: ICE in store_field bugs at qult dot net
` (13 preceding siblings ...)
2015-03-16 10:31 ` ebotcazou at gcc dot gnu.org
@ 2015-03-16 10:32 ` ebotcazou at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-03-16 10:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65409
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #14 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Thanks for reporting the problem.
^ permalink raw reply [flat|nested] 16+ messages in thread