diff mbox

picochip: simplify expression

Message ID 20101029153805.023c3b05@absol.kitzblitz
State New
Headers show

Commit Message

Nicolas Kaiser Oct. 29, 2010, 1:38 p.m. UTC
Hi there!

I noticed an expression that can be simplified like:
 (a || (!a && b)) => (a || b)

Best regards,
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
---

Comments

Hariharan Sandanagobalane Oct. 29, 2010, 1:49 p.m. UTC | #1
Sounds like a good change. Let me know if you would like me to commit this.

Cheers
Hari

On 29/10/10 14:38, Nicolas Kaiser wrote:
> Hi there!
>
> I noticed an expression that can be simplified like:
>   (a || (!a&&  b)) =>  (a || b)
>
> Best regards,
> Signed-off-by: Nicolas Kaiser<nikai@nikai.net>
> ---
> --- a/gcc/config/picochip/picochip.c	2010-10-29 11:14:04.299096263 +0200
> +++ b/gcc/config/picochip/picochip.c	2010-10-29 15:13:18.715976486 +0200
> @@ -2299,8 +2299,7 @@ picochip_is_short_branch (rtx insn)
>     int isRealShortBranch = (get_attr_length(insn) == SHORT_BRANCH_LENGTH);
>
>     return (isRealShortBranch ||
> -	  (!isRealShortBranch&&
> -	   picochip_current_vliw_state.num_insns_in_packet>  1));
> +	  picochip_current_vliw_state.num_insns_in_packet>  1);
>   }
>
>   /* Output a compare-and-branch instruction (matching the cbranch
>
diff mbox

Patch

--- a/gcc/config/picochip/picochip.c	2010-10-29 11:14:04.299096263 +0200
+++ b/gcc/config/picochip/picochip.c	2010-10-29 15:13:18.715976486 +0200
@@ -2299,8 +2299,7 @@  picochip_is_short_branch (rtx insn)
   int isRealShortBranch = (get_attr_length(insn) == SHORT_BRANCH_LENGTH);
 
   return (isRealShortBranch ||
-	  (!isRealShortBranch &&
-	   picochip_current_vliw_state.num_insns_in_packet > 1));
+	  picochip_current_vliw_state.num_insns_in_packet > 1);
 }
 
 /* Output a compare-and-branch instruction (matching the cbranch