This is the mail archive of the gcc-patches@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: [PATCH] Fix PR optimization/10876


>     I was using Chris' notation, so the problematic pattern is actually
>
> 	(plus (reg) (const_int 4096))
>
>     which is not valid on SPARC, whereas
>
> 	(minus (reg) (const_int -4096))
>
>     would be, without the canonicalization restriction.
>
> I think you are confused.  If the latter is valid, then whatever code
> would be generated for it is generated for the former, since they are
> equivalent.

No, I only exposed the problem in RTL notation to avoid using SPARC assembly. 
In other words: the direct translation in SPARC assembly of the first form 
is impossible, while that of the second is possible.

Currently the SPARC port (illegally according to the canonicalization rules) 
turns the first form into the second one at the RTL expander level. Zack and 
Jakub suggested the correct fix, which is to do the transformation only when 
emitting assembly code.

-- 
Eric Botcazou


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