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]

Re: CONST fixes


> 
> I'm not convinced that the mode of CONST should always be Pmode,
> I suspect there are cases when it can be something else, for instance
> 
> (const:HI (truncate:HI (minus:SI (label_ref 1) (label_ref 2)) 0))
> 
I guess that it is cleaner to put CONST inside truncate and
make it Pmode tought.
> in RTL representing a folded pc-relative switch statement.  I guess if
> there is code to check this, then if it ever happens we'll find about
> it :-).
> 
> Since CONST doesn't change the value of the thing inside it, it should
> certainly have the same mode, just like NEG should have the same mode
> as its operand.
The purpose why my checker accepted this is that it generally accept VOIDmode
at the place of othe rmodes - since (neg:SI (const_int 0)) is valid.  It also
can't refuse VOIDmode on unspec IMO, thats why it don't see it and the rtl is
probably valid, even when in weird way. I guess I can get rid of most
unspecs there - the code just does valid operations, like loading value of
symbol to register, even when it does it in complex steps.

Does idea of allowing other modes on CONST (and modifying the docs in this way)
sound fine to everyone?

Honza
> -- 
> - Geoffrey Keating <geoffk@cygnus.com>

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