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


On Fri, 30 Jan 2004, Syd Polk wrote:

> The problem is this:
> 
>    const int shift = 3;
>    r2 = __rlwimi (r, arg, shift, 5, 8);

So what *is* the specification (language-standard-level) of the valid
arguments?  shift here isn't an integer constant expression for C, only
for C++, so presumably you aren't wanting to restrict things to integer
constant expressions.  But "anything the compiler can show is constant"
(do you then allow a variable argument to a built-in function as long as
in every call to that function the argument is constant?) isn't a good
specification; with that as a specification, user code could break between
minor releases if a problematic optimisation that code depended on in this
way is disabled.

-- 
Joseph S. Myers
jsm@polyomino.org.uk


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