This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12260] [3.4 Regression] ICE in output_operand: invalid expression as operand
- From: "falk at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Sep 2003 21:11:11 -0000
- Subject: [Bug optimization/12260] [3.4 Regression] ICE in output_operand: invalid expression as operand
- References: <20030912073234.12260.falk@debian.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12260
falk at debian dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
------- Additional Comments From falk at debian dot org 2003-09-23 21:11 -------
The problem is caused by output_operand getting passed this rtx:
(neg:DI (const:DI (plus:DI (symbol_ref:DI ("buf")
[flags 0x2]
<var_decl 0x200002a6680 buf>)
(const_int -1 [0xffffffffffffffff]))))
which it doesn't know how to handle. It originates from gcse, which adds to this
insn:
(insn 34 33 35 2
(set (reg:DI 79)
(minus:DI (reg:DI 80)
(reg/v/f:DI 72 [ op ]))) 28 {subdi3} (nil)
(nil))
this note:
(neg:DI (const:DI (plus:DI (symbol_ref:DI ("buf")
[flags 0x2]
<var_decl 0x200002a6680 buf>)
(const_int -1 [0xffffffffffffffff]))))
It seems that gcc decided (op - buf) + 1 would be better calculated as
op + (-buf - 1). Phil's regression hunter says:
Search converges between 2003-09-11-trunk (#398) and 2003-09-12-trunk (#399).
I suspect this patch exposed the problem:
2003-09-10 Roger Sayle <roger@eyesopen.com>
* combine.c (combine_simplify_rtx): Move several NOT and NEG
optimizations from here...
* simplify-rtx.c (simplify_unary_operation): to here. Recursively
simplify expressions using simplify_gen_*ary instead of gen_rtx_*.
The transformation seems valid, so I guess a simple solution would be to
have output_operand handle (neg x) just like (0 - x). I don't know whether
all assemblers would like that, though...