This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Check precision in STRIP_NOPS when possible (take 2)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Adam Nemet <anemet at caviumnetworks dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 11 Jun 2009 08:50:02 +0200
- Subject: Re: [PATCH] Check precision in STRIP_NOPS when possible (take 2)
- References: <firstname.lastname@example.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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:
> 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)).