rs6000: Remove duplicate expression [PR106907]

Message ID 5a8be692-5779-1b9a-e387-073da84fbebe@linux.vnet.ibm.com
State Committed
Commit c4deccd44655c5d748dfed200a37f2b678c32fe8
Headers
Series rs6000: Remove duplicate expression [PR106907] |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Testing passed

Commit Message

jeevitha June 5, 2023, 6:41 a.m. UTC
  PR106907 has few warnings spotted from cppcheck. In that addressing duplicate
expression issue here. Here the same expression is used twice in logical
AND(&&) operation which result in same result so removing that.

2023-06-05  Jeevitha Palanisamy  <jeevitha@linux.ibm.com>

gcc/
	PR target/106907
	* config/rs6000/rs6000.cc (vec_const_128bit_to_bytes): Remove
	duplicate expression.
  

Comments

Segher Boessenkool June 5, 2023, 9:22 a.m. UTC | #1
Hi!

On Mon, Jun 05, 2023 at 12:11:42PM +0530, P Jeevitha wrote:
> PR106907 has few warnings spotted from cppcheck. In that addressing duplicate
> expression issue here. Here the same expression is used twice in logical
> AND(&&) operation which result in same result so removing that.
> 
> 2023-06-05  Jeevitha Palanisamy  <jeevitha@linux.ibm.com>
> 
> gcc/
> 	PR target/106907
> 	* config/rs6000/rs6000.cc (vec_const_128bit_to_bytes): Remove
> 	duplicate expression.
> 
> 
> diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
> index 42f49e4a56b..d197c3f3289 100644
> --- a/gcc/config/rs6000/rs6000.cc
> +++ b/gcc/config/rs6000/rs6000.cc
> @@ -28784,7 +28784,6 @@ vec_const_128bit_to_bytes (rtx op,
>  
>    info->all_words_same
>      = (info->words[0] == info->words[1]
> -       && info->words[0] == info->words[1]
>         && info->words[0] == info->words[2]
>         && info->words[0] == info->words[3]);

Thanks!  Okay for trunk.  Also okay for all backports, no need to wait
if unexpected problems in trunk show up.  But still, backport to 13
first, then 12, then 11, only stop when it stops applying (or there are
no open release branches left) :-)


Segher
  
jeevitha June 6, 2023, 3:56 p.m. UTC | #2
Thanks for reviewing Segher. Will work on backports as well :).


Jeevitha
  

Patch

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 42f49e4a56b..d197c3f3289 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -28784,7 +28784,6 @@  vec_const_128bit_to_bytes (rtx op,
 
   info->all_words_same
     = (info->words[0] == info->words[1]
-       && info->words[0] == info->words[1]
        && info->words[0] == info->words[2]
        && info->words[0] == info->words[3]);