diff mbox

Fix TYPE_OVERFLOW_* cleanup fallout

Message ID 20141212134807.GX16332@redhat.com
State New
Headers show

Commit Message

Marek Polacek Dec. 12, 2014, 1:48 p.m. UTC
On ARM we ICE on fixed-point-exec.c testcase because TYPE_OVERFLOW_WRAPS
was missing the ANY_INTEGRAL_TYPE_P check.

Bootstrapped/regtested on x86_64-linux and ppc64-linux, ok for trunk?

2014-12-12  Marek Polacek  <polacek@redhat.com>

	PR middle-end/64274
	* fold-const.c (fold_binary_loc): Add ANY_INTEGRAL_TYPE_P check.


	Marek

Comments

Richard Biener Dec. 12, 2014, 1:50 p.m. UTC | #1
On Fri, 12 Dec 2014, Marek Polacek wrote:

> On ARM we ICE on fixed-point-exec.c testcase because TYPE_OVERFLOW_WRAPS
> was missing the ANY_INTEGRAL_TYPE_P check.
> 
> Bootstrapped/regtested on x86_64-linux and ppc64-linux, ok for trunk?

Ok.

THanks,
Richard.

> 2014-12-12  Marek Polacek  <polacek@redhat.com>
> 
> 	PR middle-end/64274
> 	* fold-const.c (fold_binary_loc): Add ANY_INTEGRAL_TYPE_P check.
> 
> diff --git gcc/fold-const.c gcc/fold-const.c
> index ec5ad98..d71fa94 100644
> --- gcc/fold-const.c
> +++ gcc/fold-const.c
> @@ -10082,7 +10082,8 @@ fold_binary_loc (location_t loc,
>  	  /* Reassociate (plus (plus (mult) (foo)) (mult)) as
>  	     (plus (plus (mult) (mult)) (foo)) so that we can
>  	     take advantage of the factoring cases below.  */
> -	  if (TYPE_OVERFLOW_WRAPS (type)
> +	  if (ANY_INTEGRAL_TYPE_P (type)
> +	      && TYPE_OVERFLOW_WRAPS (type)
>  	      && (((TREE_CODE (arg0) == PLUS_EXPR
>  		    || TREE_CODE (arg0) == MINUS_EXPR)
>  		   && TREE_CODE (arg1) == MULT_EXPR)
> 
> 	Marek
> 
>
Kyrylo Tkachov Dec. 12, 2014, 1:57 p.m. UTC | #2
On 12/12/14 13:48, Marek Polacek wrote:
> On ARM we ICE on fixed-point-exec.c testcase because TYPE_OVERFLOW_WRAPS
> was missing the ANY_INTEGRAL_TYPE_P check.
>
> Bootstrapped/regtested on x86_64-linux and ppc64-linux, ok for trunk?

Also arm-none-linux-gnueabihf bootstrap is in late stage3 and looks fine.

Thanks,
Kyril

>
> 2014-12-12  Marek Polacek  <polacek@redhat.com>
>
> 	PR middle-end/64274
> 	* fold-const.c (fold_binary_loc): Add ANY_INTEGRAL_TYPE_P check.
>
> diff --git gcc/fold-const.c gcc/fold-const.c
> index ec5ad98..d71fa94 100644
> --- gcc/fold-const.c
> +++ gcc/fold-const.c
> @@ -10082,7 +10082,8 @@ fold_binary_loc (location_t loc,
>   	  /* Reassociate (plus (plus (mult) (foo)) (mult)) as
>   	     (plus (plus (mult) (mult)) (foo)) so that we can
>   	     take advantage of the factoring cases below.  */
> -	  if (TYPE_OVERFLOW_WRAPS (type)
> +	  if (ANY_INTEGRAL_TYPE_P (type)
> +	      && TYPE_OVERFLOW_WRAPS (type)
>   	      && (((TREE_CODE (arg0) == PLUS_EXPR
>   		    || TREE_CODE (arg0) == MINUS_EXPR)
>   		   && TREE_CODE (arg1) == MULT_EXPR)
>
> 	Marek
>
diff mbox

Patch

diff --git gcc/fold-const.c gcc/fold-const.c
index ec5ad98..d71fa94 100644
--- gcc/fold-const.c
+++ gcc/fold-const.c
@@ -10082,7 +10082,8 @@  fold_binary_loc (location_t loc,
 	  /* Reassociate (plus (plus (mult) (foo)) (mult)) as
 	     (plus (plus (mult) (mult)) (foo)) so that we can
 	     take advantage of the factoring cases below.  */
-	  if (TYPE_OVERFLOW_WRAPS (type)
+	  if (ANY_INTEGRAL_TYPE_P (type)
+	      && TYPE_OVERFLOW_WRAPS (type)
 	      && (((TREE_CODE (arg0) == PLUS_EXPR
 		    || TREE_CODE (arg0) == MINUS_EXPR)
 		   && TREE_CODE (arg1) == MULT_EXPR)