This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Help restricting args of an intrinsic function
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Syd Polk <spolk at apple dot com>
- Cc: GCC List <gcc at gcc dot gnu dot org>
- Date: 30 Jan 2004 19:53:01 -0500
- Subject: Re: Help restricting args of an intrinsic function
- References: <F371467E-5386-11D8-93D6-0003931B8A28@apple.com>
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