bug fix in reload1.c

Weiwen Liu liu@hepvms.physics.yale.edu
Tue Dec 9 08:33:00 GMT 1997


On Tue, 9 Dec 1997, Richard Henderson wrote:

> > This new RTL has 2 operands instead of 3 in the old RTL.  This change
> > causes find_reloads to abort at line 2536 in reload.c, because
> > recog_operand[2] is NULL.
> >        
> > The attached patch generates a new RTL in eliminate_regs
> > (set (mem:DI (plus:DI (reg:DI 30)
> >              (const_int 104)))
> >         (minus:SI (subreg:DI (reg:SI 2) 0)

Sorry, there is a typo here.  It should have been
         (minus:DI (subreg:DI (reg:SI 2) 0)

> >             (subreg:DI (subreg:SI (reg:HI 612) 0) 0)))
> > to keep 3 operands.
> 
> There is definitely a problem, but this is not the solution, as we must
> make all of the modes match.  We'd like to end up with, after reload,
> 
>   (set (reg:SI T)
>        (minus:SI (reg:SI 2)
>          (subreg:SI (reg:HI 612) 0)))
>   (set (mem:DI (plus:DI (reg:DI 30)
> 		  (const_int 104)))
>        (subreg:DI (reg:SI T)))
> 

There might be a problem here, because, I believe, recog_memoized in
reload1 will not be able to analyze this insn.  While I was working on
this bug, recog_memoized (or insn_recog) was not able to analyze
(set (mem:DI (plus:DI (reg:DI 30)
		(const_int 104)))
	(subreg:DI (minus:SI (reg:SI 2)
		(subreg:SI (reg:HI 612) 0)) 0)))

> or
> 
>   (set (reg:DI T)
>        (sign_extend:DI (minus:SI (reg:SI 2)
> 			  (subreg:SI (reg:HI 612) 0))))
>   (set (mem:DI (plus:DI (reg:DI 30)
> 		  (const_int 104)))
>        (reg:DI T))
> 
> Almost anything else is wrong.  I don't know exactly what to do from
> here, but I'm working on it.
> 
> 
> r~
> 




More information about the Gcc-bugs mailing list