This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Possible bug in regrename.c???


movhi is accepting all general operands, which makes GCC able to generate this pattern. Use a predicate function and constraint letters to restrict which patterns movhi is accepting. The avr port is dividing movhi into a define_expand and a define_insn, which is a good solution.

Anders

On Mon, 28 Jul 2003 19:03:39 +1000, Marty Hauff <marty.hauff@rmit.edu.au> wrote:

The port that I'm doing is based around the AVR and it already has GO_IF_LEGITIMATE_ADDRESS defined. The change that I have made which seems to break the port is modifying the movhi RTX to the following:

(define_insn "movhi" [(set (match_operand:HI 0 "general_operand" "") (match_operand:HI 1 "general_operand" ""))]
""
";movhi_" )


I'm not sure where the GO_IF_LEGITIMATE_ADDRESS macro is used but it certainly isn't called anywhere near where the code is segfaulting. A better macro definition may prevent the offending RTX from being created in the first place but as far as I can see, the offending RTX is legal and therefore should not cause the compiler to segfault???

I'll follow your suggestion through some more though...

Marty Moose

Anders Ãdland <aaadland@atmel.no> 07/28/03 16:56 PM >>>
On Sun, 27 Jul 2003 16:08:39 +1000, Marty Hauff <marty.hauff@rmit.edu.au> wrote:

I'm still new to GCC but I stumbled across the following anomoly whilst trying to make a new port.

The following RTX:
(set  (mem:HI  (reg/v/f:HI 8 r8 [44]) [8 S2 A8])
(mem:HI  (pre_dec:HI  (mem:HI  (plus:HI  (reg/f:HI 28 r28)
(const_int 3 [0x3])) [17 S2 A8])) [8 S2 A8]))

causes set_value_regno() to segfault.

I'm new to GCC too, but had a similar problem. It looks like a pseudo register is replaced by a memory reference. Is GO_IF_LEGITIMATE_ADDRESS defined properly, with one strict and one non-strict variant?


Anders







Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]