* [Bug target/20928] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
@ 2005-04-10 15:08 ` aj at gcc dot gnu dot org
2005-04-10 15:08 ` aj at gcc dot gnu dot org
` (13 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: aj at gcc dot gnu dot org @ 2005-04-10 15:08 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|ICE: unrecognoizable insns |ICE: unrecognizable insns
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
2005-04-10 15:08 ` [Bug target/20928] ICE: unrecognizable insns aj at gcc dot gnu dot org
@ 2005-04-10 15:08 ` aj at gcc dot gnu dot org
2005-04-10 16:02 ` steven at gcc dot gnu dot org
` (12 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: aj at gcc dot gnu dot org @ 2005-04-10 15:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From aj at gcc dot gnu dot org 2005-04-10 15:08 -------
Created an attachment (id=8579)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8579&action=view)
Preprocessed source file
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
2005-04-10 15:08 ` [Bug target/20928] ICE: unrecognizable insns aj at gcc dot gnu dot org
2005-04-10 15:08 ` aj at gcc dot gnu dot org
@ 2005-04-10 16:02 ` steven at gcc dot gnu dot org
2005-04-10 16:03 ` [Bug target/20928] [4.0/4.1 regression] " steven at gcc dot gnu dot org
` (11 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-04-10 16:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-04-10 16:01 -------
Also happens with mainline.
extern struct symbol_tab_
{
void *S_nil;
} symbol_tab_data;
typedef struct
{
unsigned int length;
void *data[0];
} s;
void *
allocate_vector (unsigned int len)
{
unsigned int need;
s *ptr;
void *obj;
ptr->length = len;
void **p = &ptr->data[0];
do {
*p++ = ((((unsigned char *) ((&symbol_tab_data.S_nil)) +
((unsigned long int) (((1L << (2)))) << 48))));
} while (!(--len == 0));
return obj;
}
t.c: In function 'allocate_vector':
t.c:25: error: unrecognizable insn:
(insn 56 55 51 0 (set (reg/f:DI 70)
(plus:DI (reg:DI 73)
(const_int 1125899906842624 [0x4000000000000]))) -1
(insn_list:REG_DEP_TRUE 55 (nil))
(expr_list:REG_DEAD (reg:DI 73)
(expr_list:REG_EQUAL (const:DI (plus:DI (symbol_ref:DI
("symbol_tab_data") [flags 0x40] <var_decl 0x2a95a36270 symbol_tab_data>)
(const_int 1125899906842624 [0x4000000000000])))
(nil))))
t.c:25: internal compiler error: in extract_insn, at recog.c:2082
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-04-10 16:01:50
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-04-10 16:02 ` steven at gcc dot gnu dot org
@ 2005-04-10 16:03 ` steven at gcc dot gnu dot org
2005-04-10 16:08 ` steven at gcc dot gnu dot org
` (10 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-04-10 16:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-04-10 16:03 -------
Needs "-O -mtune=k8 -fPIC" of course. -fPIC seems to cause the problem.
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Summary|ICE: unrecognizable insns |[4.0/4.1 regression] ICE:
| |unrecognizable insns
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-04-10 16:03 ` [Bug target/20928] [4.0/4.1 regression] " steven at gcc dot gnu dot org
@ 2005-04-10 16:08 ` steven at gcc dot gnu dot org
2005-04-10 17:24 ` steven at gcc dot gnu dot org
` (9 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-04-10 16:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-04-10 16:08 -------
Double *sigh*.
The old loop optimizer introduces the offending insn. From the .loop dump:
Insn 26: regno 70 (life 1), move-insn forces 25 savings 1 moved to 56
Hoisted regno 74 r/o from (mem/u/c:DI (const:DI (unspec:DI [
(symbol_ref:DI ("symbol_tab_data") [flags 0x40] <var_decl
0x2a95a36270 symbol_tab_data>)
] 2)) [0 S8 A8])
...
(insn 56 55 51 0 (set (reg/f:DI 70)
(plus:DI (reg:DI 73)
(const_int 1125899906842624 [0x4000000000000]))) -1 (nil)
(expr_list:REG_EQUAL (const:DI (plus:DI (symbol_ref:DI ("symbol_tab_data")
[flags 0x40] <var_decl 0x2a95a36270 symbol_tab_data>)
(const_int 1125899906842624 [0x4000000000000])))
(nil)))
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-04-10 16:08 ` steven at gcc dot gnu dot org
@ 2005-04-10 17:24 ` steven at gcc dot gnu dot org
2005-04-10 17:39 ` steven at gcc dot gnu dot org
` (8 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-04-10 17:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-04-10 17:24 -------
After CSE1 (t.c.04.cse) we have:
(insn 20 18 22 1 (set (reg:DI 66)
(mem/u/c:DI (const:DI (unspec:DI [
(symbol_ref:DI ("bar") [flags 0x40] <var_decl
0x2a95a2f000 bar>)
] 2)) [0 S8 A8])) 81 {*movdi_1_rex64} (nil)
(nil))
(insn 22 20 23 1 (set (reg:DI 68)
(const_int 2147483648 [0x80000000])) 81 {*movdi_1_rex64} (nil)
(nil))
(insn 23 22 24 1 (parallel [
(set (reg:DI 67)
(plus:DI (reg:DI 66)
(reg:DI 68)))
(clobber (reg:CC 17 flags))
]) 193 {*adddi_1_rex64} (nil)
(expr_list:REG_EQUAL (const:DI (plus:DI (symbol_ref:DI ("bar") [flags
0x40] <var_decl 0x2a95a2f000 bar>)
(const_int 2147483648 [0x80000000])))
(nil)))
but old loop (t.c.06.loop) somehow turns this into:
(insn 45 48 46 0 (set (reg:DI 69)
(mem/u/c:DI (const:DI (unspec:DI [
(symbol_ref:DI ("bar") [flags 0x40] <var_decl
0x2a95a2f000 bar>)
] 2)) [0 S8 A8])) -1 (nil)
(nil))
(insn 46 45 41 0 (set (reg/f:DI 67)
(plus:DI (reg:DI 69)
(const_int 2147483648 [0x80000000]))) -1 (nil)
(expr_list:REG_EQUAL (const:DI (plus:DI (symbol_ref:DI ("bar") [flags
0x40] <var_decl 0x2a95a2f000 bar>)
(const_int 2147483648 [0x80000000])))
(nil)))
Note how we have lost a clobber and turned a reg+reg addition into a reg+imm;
from:
(set (reg:DI 66) (mem:DI (const:DI (unspec:DI [(symbol_ref:DI ("bar"))]))))
(set (reg:DI 68) (const_int 2147483648 [0x80000000]))
(parallel [
(set (reg:DI 67) (plus:DI (reg:DI 66) (reg:DI 68)))
(clobber (reg:CC 17 flags))])
to:
(set (reg:DI 69) (mem:DI (const:DI (unspec:DI [(symbol_ref:DI ("bar"))]))))
(set (reg/f:DI 67) (plus:DI (reg:DI 69) (const_int 2147483648 [0x80000000])))
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-04-10 17:24 ` steven at gcc dot gnu dot org
@ 2005-04-10 17:39 ` steven at gcc dot gnu dot org
2005-04-10 17:52 ` steven at gcc dot gnu dot org
` (7 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-04-10 17:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-04-10 17:39 -------
The offending insn is created by emit_move_insn in loop.c, here:
2354 start_sequence ();
2355 emit_move_insn (m->insert_temp ? newreg : m->set_dest,
2356 m->set_src);
2357 seq = get_insns ();
2358 end_sequence ();
(gdb) p debug_rtx_list (seq, 10)
(insn 45 0 46 (set (reg:DI 69)
(mem/u/c:DI (const:DI (unspec:DI [
(symbol_ref:DI ("bar") [flags 0x40] <var_decl
0x2a95a2f000 bar>)
] 2)) [0 S8 A8])) -1 (nil)
(nil))
(insn 46 45 0 (set (reg/f:DI 67)
(plus:DI (reg:DI 69)
(const_int 2147483648 [0x80000000]))) -1 (nil)
(expr_list:REG_EQUAL (const:DI (plus:DI (symbol_ref:DI ("bar") [flags
0x40] <var_decl 0x2a95a2f000 bar>)
(const_int 2147483648 [0x80000000])))
(nil)))
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-04-10 17:39 ` steven at gcc dot gnu dot org
@ 2005-04-10 17:52 ` steven at gcc dot gnu dot org
2005-04-10 19:03 ` steven at gcc dot gnu dot org
` (6 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-04-10 17:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-04-10 17:52 -------
My RTL-fu is way below par, so perhaps this doesn't make sense at all, but...
It seems that emit_move_insn must always produce valid move insns. So it
should check that an immediate is a valid PIC operand if -fPIC. In this case
I'd say LEGITIMATE_CONSTANT_P is the wrong target macro to use. So you would
have this instead:
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.783
diff -u -3 -p -r1.783 expr.c
--- expr.c 30 Mar 2005 21:34:23 -0000 1.783
+++ expr.c 10 Apr 2005 17:51:01 -0000
@@ -3093,7 +3093,8 @@ emit_move_insn (rtx x, rtx y)
y_cst = y;
- if (!LEGITIMATE_CONSTANT_P (y))
+ if ((!flag_pic && !LEGITIMATE_CONSTANT_P (y))
+ || (flag_pic && !LEGITIMATE_PIC_OPERAND_P (y)))
{
y = force_const_mem (mode, y);
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-04-10 17:52 ` steven at gcc dot gnu dot org
@ 2005-04-10 19:03 ` steven at gcc dot gnu dot org
2005-04-10 21:05 ` steven at gcc dot gnu dot org
` (5 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-04-10 19:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-04-10 19:03 -------
FWIW, smallest test case I could find:
extern struct bar_t bar;
void
foo (void)
{
void **p;
do {
*p++ = ((unsigned char *) &bar + ((unsigned long int) 1L << 31));
} while (p);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
` (8 preceding siblings ...)
2005-04-10 19:03 ` steven at gcc dot gnu dot org
@ 2005-04-10 21:05 ` steven at gcc dot gnu dot org
2005-04-21 5:06 ` mmitchel at gcc dot gnu dot org
` (4 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-04-10 21:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-04-10 21:05 -------
Alexandre Oliva pointed out to me that it was probably the expander who
should produce a proper legitimate insn. I looked at this some more and
found that in legitimize_pic_address we do not check if a displacement
is a valid PIC displacement:
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.807
diff -u -3 -p -r1.807 i386.c
--- config/i386/i386.c 9 Apr 2005 17:19:48 -0000 1.807
+++ config/i386/i386.c 10 Apr 2005 21:01:26 -0000
@@ -5612,7 +5612,13 @@ legitimize_pic_address (rtx orig, rtx re
base == reg ? NULL_RTX : reg);
if (GET_CODE (new) == CONST_INT)
- new = plus_constant (base, INTVAL (new));
+ {
+ if (legitimate_pic_address_disp_p (new))
+ new = plus_constant (base, INTVAL (new));
+ else
+ new = gen_rtx_PLUS (Pmode, base,
+ copy_to_mode_reg (Pmode, new));
+ }
else
{
if (GET_CODE (new) == PLUS && CONSTANT_P (XEXP (new, 1)))
This looks to me like much better hack (maybe even a proper fix!) so I'll
test this to see what happens...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
` (9 preceding siblings ...)
2005-04-10 21:05 ` steven at gcc dot gnu dot org
@ 2005-04-21 5:06 ` mmitchel at gcc dot gnu dot org
2005-05-21 7:00 ` aj at gcc dot gnu dot org
` (3 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-04-21 5:06 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.0 |4.0.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
` (10 preceding siblings ...)
2005-04-21 5:06 ` mmitchel at gcc dot gnu dot org
@ 2005-05-21 7:00 ` aj at gcc dot gnu dot org
2005-06-08 0:09 ` rth at gcc dot gnu dot org
` (2 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: aj at gcc dot gnu dot org @ 2005-05-21 7:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From aj at gcc dot gnu dot org 2005-05-21 07:00 -------
Steven, any update on this one? Would you like to get it assigned to?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
` (11 preceding siblings ...)
2005-05-21 7:00 ` aj at gcc dot gnu dot org
@ 2005-06-08 0:09 ` rth at gcc dot gnu dot org
2005-07-06 17:03 ` mmitchel at gcc dot gnu dot org
2005-09-27 16:24 ` mmitchel at gcc dot gnu dot org
14 siblings, 0 replies; 18+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-06-08 0:09 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rth at gcc dot gnu dot org 2005-06-08 00:08 -------
This patch trivially "fixes" the problem because the argument to
legitimate_pic_address_disp_p is incorrect, and it will always
return false.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
` (12 preceding siblings ...)
2005-06-08 0:09 ` rth at gcc dot gnu dot org
@ 2005-07-06 17:03 ` mmitchel at gcc dot gnu dot org
2005-09-27 16:24 ` mmitchel at gcc dot gnu dot org
14 siblings, 0 replies; 18+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-07-06 17:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-07-06 17:03 -------
Postponed until 4.0.2.
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.1 |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns
2005-04-10 15:07 [Bug target/20928] New: ICE: unrecognoizable insns aj at gcc dot gnu dot org
` (13 preceding siblings ...)
2005-07-06 17:03 ` mmitchel at gcc dot gnu dot org
@ 2005-09-27 16:24 ` mmitchel at gcc dot gnu dot org
14 siblings, 0 replies; 18+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:24 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.2 |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928
^ permalink raw reply [flat|nested] 18+ messages in thread