public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [IPCP] Remove unreachable code
@ 2016-10-24 22:47 kugan
  2016-10-25  3:40 ` Prathamesh Kulkarni
  2016-11-05 18:36 ` Jeff Law
  0 siblings, 2 replies; 3+ messages in thread
From: kugan @ 2016-10-24 22:47 UTC (permalink / raw)
  To: gcc-patches; +Cc: Prathamesh Kulkarni, Jan Hubicka, Martin Jambor

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]

Hi,

I noticed that in ipcp_bits_lattice::meet_with we have:

   else if (TREE_CODE_CLASS (code) == tcc_unary)
   ....
   else if (code == NOP_EXPR)
   ....

Since TREE_CODE_CLASS for NOP_EXPR is tcc_unary, if (code == NOP_EXPR) 
is unreachable and therefore removing it. I also don't think that we 
need any special casing for NOP_EXPR here. bit_value_unop handles 
already handles CASE_CONVERT.

Is this OK if no regressions in bootstrap and regression testing.

Thanks,
Kugan




gcc/ChangeLog:

2016-10-25  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* ipa-cp.c (ipcp_bits_lattice::meet_with): Remove unreachable code.

[-- Attachment #2: p1.txt --]
[-- Type: text/plain, Size: 406 bytes --]

diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 1dc5cb6..527ff27 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -1070,12 +1070,6 @@ ipcp_bits_lattice::meet_with (ipcp_bits_lattice& other, unsigned precision,
 	return set_to_bottom ();
     }
 
-  else if (code == NOP_EXPR)
-    {
-      adjusted_value = other.m_value;
-      adjusted_mask = other.m_mask;
-    }
-
   else
     return set_to_bottom ();
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [IPCP] Remove unreachable code
  2016-10-24 22:47 [IPCP] Remove unreachable code kugan
@ 2016-10-25  3:40 ` Prathamesh Kulkarni
  2016-11-05 18:36 ` Jeff Law
  1 sibling, 0 replies; 3+ messages in thread
From: Prathamesh Kulkarni @ 2016-10-25  3:40 UTC (permalink / raw)
  To: kugan; +Cc: gcc-patches, Jan Hubicka, Martin Jambor

On 25 October 2016 at 04:16, kugan <kugan.vivekanandarajah@linaro.org> wrote:
> Hi,
>
> I noticed that in ipcp_bits_lattice::meet_with we have:
>
>   else if (TREE_CODE_CLASS (code) == tcc_unary)
>   ....
>   else if (code == NOP_EXPR)
>   ....
>
> Since TREE_CODE_CLASS for NOP_EXPR is tcc_unary, if (code == NOP_EXPR) is
> unreachable and therefore removing it. I also don't think that we need any
> special casing for NOP_EXPR here. bit_value_unop handles already handles
> CASE_CONVERT.
Oops, sorry about that :/
IICU NOP_EXPR is present when the pass-thru operation is "simple"
involving only the argument.
bit_value_unop() already handles the case for NOP_EXPR in
CASE_CONVERT, so I suppose
NOP_EXPR won't need any special casing.
Thanks for catching this!

Regards,
Prathamesh
>
> Is this OK if no regressions in bootstrap and regression testing.
>
> Thanks,
> Kugan
>
>
>
>
> gcc/ChangeLog:
>
> 2016-10-25  Kugan Vivekanandarajah  <kuganv@linaro.org>
>
>         * ipa-cp.c (ipcp_bits_lattice::meet_with): Remove unreachable code.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [IPCP] Remove unreachable code
  2016-10-24 22:47 [IPCP] Remove unreachable code kugan
  2016-10-25  3:40 ` Prathamesh Kulkarni
@ 2016-11-05 18:36 ` Jeff Law
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Law @ 2016-11-05 18:36 UTC (permalink / raw)
  To: kugan, gcc-patches; +Cc: Prathamesh Kulkarni, Jan Hubicka, Martin Jambor

On 10/24/2016 04:46 PM, kugan wrote:
> Hi,
>
> I noticed that in ipcp_bits_lattice::meet_with we have:
>
>   else if (TREE_CODE_CLASS (code) == tcc_unary)
>   ....
>   else if (code == NOP_EXPR)
>   ....
>
> Since TREE_CODE_CLASS for NOP_EXPR is tcc_unary, if (code == NOP_EXPR)
> is unreachable and therefore removing it. I also don't think that we
> need any special casing for NOP_EXPR here. bit_value_unop handles
> already handles CASE_CONVERT.
>
> Is this OK if no regressions in bootstrap and regression testing.
>
> Thanks,
> Kugan
>
>
>
>
> gcc/ChangeLog:
>
> 2016-10-25  Kugan Vivekanandarajah  <kuganv@linaro.org>
>
>     * ipa-cp.c (ipcp_bits_lattice::meet_with): Remove unreachable code.
OK.
jeff


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-05 18:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-24 22:47 [IPCP] Remove unreachable code kugan
2016-10-25  3:40 ` Prathamesh Kulkarni
2016-11-05 18:36 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).