public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/32374] New: dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396
@ 2007-06-17 14:49 ubizjak at gmail dot com
2007-06-17 14:50 ` [Bug rtl-optimization/32374] " ubizjak at gmail dot com
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2007-06-17 14:49 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1374 bytes --]
Current mainline GCC ICEs when compiling attached testcase:
g++ -O2 037.cpp
037.cpp: In function void unix_parse_conf_file(FILE*, const char*, bool):
037.cpp:58: error: insn does not satisfy its constraints:
(insn 50 45 10 2 (set (reg/f:DI 54 virtual-stack-vars)
(reg:DI 0 ax)) 82 {*movdi_1_rex64} (nil))
037.cpp:58: internal compiler error: in reload_cse_simplify_operands, at
postreload.c:396
Please submit a full bug report,
This invalid RTL is created by new init-regs pass, trying to initialize
virtual-stack-vars:
(insn 45 6 9 2 (set (reg/f:DI 54 virtual-stack-vars)
(const_int 0 [0x0])) -1 (nil))
(insn 9 45 10 2 037.cpp:50 (clobber (mem/s/c:BLK (plus:DI (reg/f:DI 54
virtual-stack-vars)
(const_int -16 [0xfffffffffffffff0])) [4 A128])) -1 (nil))
--
Summary: dataflow bug: internal compiler error: in
reload_cse_simplify_operands, at postreload.c:396
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ubizjak at gmail dot com
GCC build triplet: x86_64-pc-gnu-linux
GCC host triplet: x86_64-pc-gnu-linux
GCC target triplet: x86_64-pc-gnu-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32374
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/32374] dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396
2007-06-17 14:49 [Bug rtl-optimization/32374] New: dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396 ubizjak at gmail dot com
@ 2007-06-17 14:50 ` ubizjak at gmail dot com
2007-06-17 17:18 ` [Bug rtl-optimization/32374] [4.3 Regression] " pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2007-06-17 14:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from ubizjak at gmail dot com 2007-06-17 14:50 -------
Created an attachment (id=13719)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13719&action=view)
reduced testcase
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32374
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/32374] [4.3 Regression] internal compiler error: in reload_cse_simplify_operands, at postreload.c:396
2007-06-17 14:49 [Bug rtl-optimization/32374] New: dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396 ubizjak at gmail dot com
2007-06-17 14:50 ` [Bug rtl-optimization/32374] " ubizjak at gmail dot com
@ 2007-06-17 17:18 ` pinskia at gcc dot gnu dot org
2007-06-17 18:00 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-17 17:18 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Keywords| |ice-on-valid-code
Summary|dataflow bug: internal |[4.3 Regression] internal
|compiler error: in |compiler error: in
|reload_cse_simplify_operands|reload_cse_simplify_operands
|, at postreload.c:396 |, at postreload.c:396
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32374
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/32374] [4.3 Regression] internal compiler error: in reload_cse_simplify_operands, at postreload.c:396
2007-06-17 14:49 [Bug rtl-optimization/32374] New: dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396 ubizjak at gmail dot com
2007-06-17 14:50 ` [Bug rtl-optimization/32374] " ubizjak at gmail dot com
2007-06-17 17:18 ` [Bug rtl-optimization/32374] [4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-06-17 18:00 ` pinskia at gcc dot gnu dot org
2007-06-18 5:44 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-17 18:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2007-06-17 18:00 -------
Reduced testcase:
typedef long unsigned int size_t;
extern int *stderr;
void f(int *, const char *, ...);
void g (const char *conf_name)
{
typedef struct
{
const char *label;
const int value;
} Section;
const Section sections[2] =
{ {"", 0}, {"", 1} };
f (stderr, "", "", conf_name, 0, sections[0]);
f (stderr, "", "", conf_name, 0, sections[0]);
}
------- cut --------
Note I think the orginal reduced testcase had undefined code at runtime
invoking fprintf with "%s" with a struct.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-06-17 18:00:25
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32374
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/32374] [4.3 Regression] internal compiler error: in reload_cse_simplify_operands, at postreload.c:396
2007-06-17 14:49 [Bug rtl-optimization/32374] New: dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396 ubizjak at gmail dot com
` (2 preceding siblings ...)
2007-06-17 18:00 ` pinskia at gcc dot gnu dot org
@ 2007-06-18 5:44 ` pinskia at gcc dot gnu dot org
2007-06-18 22:36 ` ubizjak at gmail dot com
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-18 5:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2007-06-18 05:44 -------
I don't know if this is data flow related any more, due to the reporting of PR
32389.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |32389
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32374
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/32374] [4.3 Regression] internal compiler error: in reload_cse_simplify_operands, at postreload.c:396
2007-06-17 14:49 [Bug rtl-optimization/32374] New: dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396 ubizjak at gmail dot com
` (3 preceding siblings ...)
2007-06-18 5:44 ` pinskia at gcc dot gnu dot org
@ 2007-06-18 22:36 ` ubizjak at gmail dot com
2007-06-19 8:27 ` [Bug middle-end/32374] " ubizjak at gmail dot com
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2007-06-18 22:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from ubizjak at gmail dot com 2007-06-18 22:36 -------
(In reply to comment #3)
> I don't know if this is data flow related any more, due to the reporting of PR
> 32389.
No, this one is caused by dataflow.
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn|32389 |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32374
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/32374] [4.3 Regression] internal compiler error: in reload_cse_simplify_operands, at postreload.c:396
2007-06-17 14:49 [Bug rtl-optimization/32374] New: dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396 ubizjak at gmail dot com
` (4 preceding siblings ...)
2007-06-18 22:36 ` ubizjak at gmail dot com
@ 2007-06-19 8:27 ` ubizjak at gmail dot com
2007-06-19 8:58 ` ubizjak at gmail dot com
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2007-06-19 8:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from ubizjak at gmail dot com 2007-06-19 08:27 -------
(In reply to comment #4)
> No, this one is caused by dataflow.
Dataflow uncovered generic middle-end (RTL?) problem:
We have this comment in instantiate_virutal_regs():
/* Scan through all the insns, instantiating every virtual register still
present. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
if (INSN_P (insn))
{
/* These patterns in the instruction stream can never be recognized.
Fortunately, they shouldn't contain virtual registers either. */
if (GET_CODE (PATTERN (insn)) == USE
|| GET_CODE (PATTERN (insn)) == CLOBBER
|| GET_CODE (PATTERN (insn)) == ADDR_VEC
|| GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
|| GET_CODE (PATTERN (insn)) == ASM_INPUT)
continue;
instantiate_virtual_regs_in_insn (insn);
However, for reduced testcase we generate following creative sequence to put
*.LC0 into virtual-outgoing-args and 0 into virtual-outgoing-args+8 (these are
sections[0] values):
;; f (stderr, &""[0], &""[0], conf_name, 0, sections[0])
(insn 6 5 7 pr32374.c:13 (clobber (mem/s/c:BLK (plus:DI (reg/f:DI 54
virtual-stack-vars)
(const_int -16 [0xfffffffffffffff0])) [5 A128])) -1 (nil))
(insn 7 6 8 pr32374.c:13 (set (mem/s/c:DI (plus:DI (reg/f:DI 54
virtual-stack-vars)
(const_int -16 [0xfffffffffffffff0])) [4 S8 A128])
(symbol_ref/f:DI ("*.LC0") [flags 0x2] <string_cst 0xb7cf1498>)) -1
(nil))
(insn 8 7 9 pr32374.c:13 (set (mem/s/c:SI (plus:DI (reg/f:DI 54
virtual-stack-vars)
(const_int -8 [0xfffffffffffffff8])) [3 S4 A64])
(const_int 0 [0x0])) -1 (nil))
(insn 9 8 10 pr32374.c:13 (set (reg:DI 59)
(mem/s/c:DI (plus:DI (reg/f:DI 54 virtual-stack-vars)
(const_int -16 [0xfffffffffffffff0])) [5 S8 A128])) -1 (nil))
(insn 10 9 11 pr32374.c:13 (set (mem:DI (reg/f:DI 56 virtual-outgoing-args) [0
S8 A64])
(reg:DI 59)) -1 (nil))
(insn 11 10 12 pr32374.c:13 (set (reg:DI 60)
(mem/s/c:DI (plus:DI (reg/f:DI 54 virtual-stack-vars)
(const_int -8 [0xfffffffffffffff8])) [5 S8 A64])) -1 (nil))
(insn 12 11 13 pr32374.c:13 (set (mem:DI (plus:DI (reg/f:DI 56
virtual-outgoing-args)
(const_int 8 [0x8])) [0 S8 A64])
(reg:DI 60)) -1 (nil))
Putting a break on emit_insn_raw, we can backtrack where (invalid!) clobber is
generated:
#0 make_insn_raw (pattern=0xb7d0ad00) at
../../gcc-svn/trunk/gcc/emit-rtl.c:3312
#1 0x081861c2 in emit_insn (x=0xb7d0ad00) at
../../gcc-svn/trunk/gcc/emit-rtl.c:4347
#2 0x081a9821 in store_constructor (exp=0xb7d63dc8, target=0xb7d4f768,
cleared=0, size=16) at ../../gcc-svn/trunk/gcc/expr.c:5066
#3 0x081aee5b in expand_expr_real_1 (exp=0x11, target=0xb7d4f768,
tmode=VOIDmode, modifier=EXPAND_STACK_PARM, alt_rtl=0x0) at
../../gcc-svn/trunk/gcc/expr.c:7310
#4 0x081bf7cc in expand_expr_real (exp=0xb7d63dc8, target=0xb7d4f6f0,
tmode=VOIDmode, modifier=EXPAND_STACK_PARM, alt_rtl=0x0) at
../../gcc-svn/trunk/gcc/expr.c:6862
#5 0x081bf9b6 in expand_expr (exp=0x11, target=0xb7d0ad00, mode=VOIDmode,
modifier=EXPAND_STACK_PARM) at ../../gcc-svn/trunk/gcc/expr.h:504
#6 0x081bd4c4 in expand_expr_real_1 (exp=0xb7ca3058, target=0xb7d4f6f0,
tmode=dwarf2_read_address: Corrupted DWARF expression.
) at ../../gcc-svn/trunk/gcc/expr.c:7455
#7 0x081bf7cc in expand_expr_real (exp=0xb7ca3058, target=0xb7d4f6f0,
tmode=VOIDmode, modifier=EXPAND_STACK_PARM, alt_rtl=0x0) at
../../gcc-svn/trunk/gcc/expr.c:6862
#8 0x08115bd1 in store_one_arg (arg=0xbf96e8f0, argblock=0xb7c9c070, flags=0,
variable_size=0, reg_parm_stack_space=0) at ../../gcc-svn/trunk/gcc/expr.h:504
#9 0x0811ad60 in expand_call (exp=0xb7d5a240, target=0x0, ignore=1) at
../../gcc-svn/trunk/gcc/calls.c:2654
It can be tracked from expand_call() down to expr.c:7303, where we re-assign
target to virtual-stack-vars in this highly suspicious part of code (Irix 6?):
else
{
/* Handle calls that pass values in multiple non-contiguous
locations. The Irix 6 ABI has examples of this. */
if (target == 0 || ! safe_from_p (target, exp, 1)
|| GET_CODE (target) == PARALLEL
|| modifier == EXPAND_STACK_PARM)
target
= assign_temp (build_qualified_type (type,
(TYPE_QUALS (type)
| (TREE_READONLY (exp)
* TYPE_QUAL_CONST))),
0, TREE_ADDRESSABLE (exp), 1);
store_constructor (exp, target, 0, int_expr_size (exp));
return target;
}
Just before the call to store_constructor, we have:
p debug_rtx (target)
(mem/s/c:BLK (plus:DI (reg/f:DI 54 virtual-stack-vars)
(const_int -16 [0xfffffffffffffff0])) [5 A128])
and in store_constructor():
in store_constructor (exp=0xb7d83dc8, target=0xb7d6f768, cleared=0, size=16) at
../../gcc-svn/trunk/gcc/expr.c:5066
we proceed through:
if (! cleared)
emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
to generate the clobber above.
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|rtl-optimization |middle-end
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32374
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/32374] [4.3 Regression] internal compiler error: in reload_cse_simplify_operands, at postreload.c:396
2007-06-17 14:49 [Bug rtl-optimization/32374] New: dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396 ubizjak at gmail dot com
` (5 preceding siblings ...)
2007-06-19 8:27 ` [Bug middle-end/32374] " ubizjak at gmail dot com
@ 2007-06-19 8:58 ` ubizjak at gmail dot com
2007-06-19 11:55 ` ubizjak at gmail dot com
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2007-06-19 8:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from ubizjak at gmail dot com 2007-06-19 08:58 -------
FWIW, this shoot-in-the-dark patch fixes ICE:
Index: expr.c
===================================================================
--- expr.c (revision 125789)
+++ expr.c (working copy)
@@ -5062,8 +5062,10 @@ store_constructor (tree exp, rtx target,
cleared = 1;
}
+#if 0
if (! cleared)
emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
+#endif
/* Store each element of the constructor into the
corresponding field of TARGET. */
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32374
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/32374] [4.3 Regression] internal compiler error: in reload_cse_simplify_operands, at postreload.c:396
2007-06-17 14:49 [Bug rtl-optimization/32374] New: dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396 ubizjak at gmail dot com
` (6 preceding siblings ...)
2007-06-19 8:58 ` ubizjak at gmail dot com
@ 2007-06-19 11:55 ` ubizjak at gmail dot com
2007-06-22 18:51 ` uros at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2007-06-19 11:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from ubizjak at gmail dot com 2007-06-19 11:54 -------
Proposed patch at http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01317.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32374
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/32374] [4.3 Regression] internal compiler error: in reload_cse_simplify_operands, at postreload.c:396
2007-06-17 14:49 [Bug rtl-optimization/32374] New: dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396 ubizjak at gmail dot com
` (7 preceding siblings ...)
2007-06-19 11:55 ` ubizjak at gmail dot com
@ 2007-06-22 18:51 ` uros at gcc dot gnu dot org
2007-06-22 18:56 ` ubizjak at gmail dot com
2007-06-26 13:33 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: uros at gcc dot gnu dot org @ 2007-06-22 18:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from uros at gcc dot gnu dot org 2007-06-22 18:51 -------
Subject: Bug 32374
Author: uros
Date: Fri Jun 22 18:51:28 2007
New Revision: 125955
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125955
Log:
PR middle-end/32374
* expr.c (store_constructor): Do not clobber non-zeroed memory.
testsuite/ChangeLog:
PR middle-end/32374
* gcc.dg/pr32374.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/pr32374.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/expr.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32374
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/32374] [4.3 Regression] internal compiler error: in reload_cse_simplify_operands, at postreload.c:396
2007-06-17 14:49 [Bug rtl-optimization/32374] New: dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396 ubizjak at gmail dot com
` (8 preceding siblings ...)
2007-06-22 18:51 ` uros at gcc dot gnu dot org
@ 2007-06-22 18:56 ` ubizjak at gmail dot com
2007-06-26 13:33 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2007-06-22 18:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from ubizjak at gmail dot com 2007-06-22 18:55 -------
Fixed.
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32374
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/32374] [4.3 Regression] internal compiler error: in reload_cse_simplify_operands, at postreload.c:396
2007-06-17 14:49 [Bug rtl-optimization/32374] New: dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396 ubizjak at gmail dot com
` (9 preceding siblings ...)
2007-06-22 18:56 ` ubizjak at gmail dot com
@ 2007-06-26 13:33 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-26 13:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from pinskia at gcc dot gnu dot org 2007-06-26 13:33 -------
*** Bug 32342 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tbm at cyrius dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32374
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2007-06-26 13:33 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-17 14:49 [Bug rtl-optimization/32374] New: dataflow bug: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396 ubizjak at gmail dot com
2007-06-17 14:50 ` [Bug rtl-optimization/32374] " ubizjak at gmail dot com
2007-06-17 17:18 ` [Bug rtl-optimization/32374] [4.3 Regression] " pinskia at gcc dot gnu dot org
2007-06-17 18:00 ` pinskia at gcc dot gnu dot org
2007-06-18 5:44 ` pinskia at gcc dot gnu dot org
2007-06-18 22:36 ` ubizjak at gmail dot com
2007-06-19 8:27 ` [Bug middle-end/32374] " ubizjak at gmail dot com
2007-06-19 8:58 ` ubizjak at gmail dot com
2007-06-19 11:55 ` ubizjak at gmail dot com
2007-06-22 18:51 ` uros at gcc dot gnu dot org
2007-06-22 18:56 ` ubizjak at gmail dot com
2007-06-26 13:33 ` pinskia 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).