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: Help restricting args of an intrinsic function


Syd Polk <spolk@apple.com> writes:

> The problem is this:
> 
>    const int shift = 3;
>    r2 = __rlwimi (r, arg, shift, 5, 8);
> 
> When I get the tree for the third arg, it is of type NOP_EXPR. I tried
> just calling default_conversion() from c-typeck.c as an experiment,
> knowing that it is C-specific. However, it still came out a NOP_EXPR.

Why must you check this at the tree level?  Presumably you will
eventually generate some insn.  The insn is presumably going to
require a const int, since that is what the instruction requires.  Can
you just have the insn verify that the values are in range, and give
an error if not?

I mean, sure, it would be better to handle it at the tree
level--you'll probably give a better error message.  But you can pass
some of the job onto the final pass, can't you?

Ian


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