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 middle-end/37669


Jakub Jelinek writes:
> On Mon, Oct 20, 2008 at 01:01:06PM -0700, Adam Nemet wrote:
> > I changed to run the above loop until the highest bit in arg_mask is
> > reached.
> 
> See my comment in bugzilla, I think this is an overkill, we should just
> remove the loop which might have been useful when we had to iterate through
> the arguments, but isn't any longer.  The only values of arg_mask are
> 1, 2 and 4 and val array has 3 elements anyway, so if you want to keep the
> loop, you could at least use i < nargs && i < 3, which is cheaper than
> floor_log2.

Is this really a hot function in GCC?  If not then why make the function more
error-prone by duplicating this info.

Also I think better approach would be to move floor_log2 to a header and
inline it here which would generate the same code you are proposing.

But anyway I don't feel too strongly about this.

Adam


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