This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ada/4848: Internal compiler error in instantiate_virtual_regs_1, at function.c:3904
- To: gcc at gcc dot gnu dot org
- Subject: Re: ada/4848: Internal compiler error in instantiate_virtual_regs_1, at function.c:3904
- From: "Unruh, Erwin" <Erwin dot Unruh at fujitsu-siemens dot com>
- Date: Mon, 12 Nov 2001 12:34:12 +0100
- Cc: "Unruh, Erwin" <Erwin dot Unruh at fujitsu-siemens dot com>
Hello,
I have found a similar problem a few days ago. I got an abort at exactly the
same place, but in a different, yet unpublished port.
My reasoning was:
I found an inconsistency between recog.c and genrecog.c. It is related to the
handling of ADDRESSOF.
In recog.c:register_operand a rtx with code ADDRESSOF is allowed. In the
variable genrecog.c:preds however there is no mentioning of this code.
But instruction recognizing is used when such codes are still alive. One such
point is instantiate_virtual_regs.
I am working on a new port and got hit by
(insn 12 7 13 (set (reg:CC 100 %icc)
(compare:CC (addressof:SI (reg/v:SI 108) 107 374bc8)
(reg/f:SI 102 virtual-stack-vars))) -1 (nil)
(nil))
when compiling a small program with optimization:
void f() { long a, b[6]; a = ( &a < b ); }
When replacing the virtual-stack-vars register the recognition of the
instruction failed because the compare required two registers. The stack grows
upward so a local variable could be at offset 0 from that register.
I made some corrections in genrecog.c and realized that the definition of
PREDICATE_CODES has to be checked in all ports.
Erwin
Index: genrecog.c
===================================================================
RCS file: /usr/local/cvscpp/archive/gcc/gcc/genrecog.c,v
retrieving revision 1.1.1.1
diff -u -c -3 -p -r1.1.1.1 genrecog.c
*** genrecog.c 2001/03/28 08:57:09 1.1.1.1
--- genrecog.c 2001/11/07 13:46:16
*************** static struct pred_table
*** 186,205 ****
RTX_CODE codes[NUM_RTX_CODE];
} preds[] = {
{"general_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
! LABEL_REF, SUBREG, REG, MEM}},
#ifdef PREDICATE_CODES
PREDICATE_CODES
#endif
{"address_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
! LABEL_REF, SUBREG, REG, MEM, PLUS, MINUS, MULT}},
! {"register_operand", {SUBREG, REG}},
! {"pmode_register_operand", {SUBREG, REG}},
{"scratch_operand", {SCRATCH, REG}},
{"immediate_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
LABEL_REF}},
{"const_int_operand", {CONST_INT}},
{"const_double_operand", {CONST_INT, CONST_DOUBLE}},
! {"nonimmediate_operand", {SUBREG, REG, MEM}},
{"nonmemory_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
LABEL_REF, SUBREG, REG}},
{"push_operand", {MEM}},
--- 186,205 ----
RTX_CODE codes[NUM_RTX_CODE];
} preds[] = {
{"general_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
! LABEL_REF, SUBREG, REG, MEM, ADDRESSOF}},
#ifdef PREDICATE_CODES
PREDICATE_CODES
#endif
{"address_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
! LABEL_REF, SUBREG, REG, MEM, PLUS, MINUS, MULT, ADDRESSO>F}},
! {"register_operand", {SUBREG, REG, ADDRESSOF}},
! {"pmode_register_operand", {SUBREG, REG, ADDRESSOF}},
{"scratch_operand", {SCRATCH, REG}},
{"immediate_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
LABEL_REF}},
{"const_int_operand", {CONST_INT}},
{"const_double_operand", {CONST_INT, CONST_DOUBLE}},
! {"nonimmediate_operand", {SUBREG, REG, MEM, ADDRESSOF}},
{"nonmemory_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
LABEL_REF, SUBREG, REG}},
{"push_operand", {MEM}},
*************** static struct pred_table
*** 210,216 ****
UNORDERED, ORDERED, UNEQ, UNGE, UNGT, UNLE,
UNLT, LTGT}},
{"mode_independent_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
! LABEL_REF, SUBREG, REG, MEM}}
};
#define NUM_KNOWN_PREDS ARRAY_SIZE (preds)
--- 210,216 ----
UNORDERED, ORDERED, UNEQ, UNGE, UNGT, UNLE,
UNLT, LTGT}},
{"mode_independent_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
! LABEL_REF, SUBREG, REG, MEM, ADDRESSOF}}
};
#define NUM_KNOWN_PREDS ARRAY_SIZE (preds)
Erwin Unruh, Fujitsu Siemens Computers, C/C++ compiler group