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] Check precision in STRIP_NOPS when possible (take 2)


On Wed, Jun 10, 2009 at 06:37:33PM -0700, Adam Nemet wrote:
> This is the current version of the patch based on the thread in:
> 
>   http://gcc.gnu.org/ml/gcc-patches/2009-06/msg00711.html
> 
> Eric, Bootstrapping and testing Ada succeeded with the additional assert.
> Later however I've found that C++ created nop_expr on aggregate types for
> reinterpret_cast.  Thus the code falls back on the old TYPE_MODE equality for
> aggregate types.
> 
> There were some other cases that required special handling; I tried to comment
> them appropriately in the code.  To summarize I use precision for
> INTEGERAL_TYPE_P, POINTER_TYPE_P, OFFSET_TYPE and FLOAT_TYPE_P.
> 
> Boostrapped and regtested on x86_64-linux including Ada.
> 
> Further comments?  OK to install?

This doesn't look very efficient.  When you already call an external
function, can't you do everything STRIP_NOPS resp. STRIP_SIGN_NOPS does
in it?  Otherwise you need to call that function potentially many times
and it unnecessarily occupies space in .text section in the caller.

Just move the while loop into tree_nop_conversion resp.
tree_sign_nop_conversion, change return value to tree, replace current
return false with return exp; and return true with continue
in for (; ; exp = TREE_OPERAND (exp, 0)).

	Jakub


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