diff mbox

Obvious fix for PR66828: left shift with undefined behavior in bswap pass

Message ID 000601d0cfe9$1c051890$540f49b0$@arm.com
State New
Headers show

Commit Message

Thomas Preud'homme Aug. 6, 2015, 1:42 a.m. UTC
Hi,

> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Thomas Preud'homme
> Sent: Tuesday, July 28, 2015 3:04 PM
> 
> > From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> > owner@gcc.gnu.org] On Behalf Of Thomas Preud'homme
> >
> > ChangeLog entry is as follows:
> >
> > 2015-07-28  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> >
> >         PR tree-optimization/66828
> >         * tree-ssa-math-opts.c (perform_symbolic_merge): Change type
> of
> > inc
> >         from int64_t to uint64_t.

Can I backport this change to GCC 5 branch? The patch applies cleanly on
GCC 5 and shows no regression on a native x86_64-linux-gnu bootstrapped
GCC and an arm-none-eabi GCC cross-compiler.


Best regards,

Thomas

Comments

Richard Biener Aug. 11, 2015, 7:43 a.m. UTC | #1
On Thu, 6 Aug 2015, Thomas Preud'homme wrote:

> Hi,
> 
> > From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> > owner@gcc.gnu.org] On Behalf Of Thomas Preud'homme
> > Sent: Tuesday, July 28, 2015 3:04 PM
> > 
> > > From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> > > owner@gcc.gnu.org] On Behalf Of Thomas Preud'homme
> > >
> > > ChangeLog entry is as follows:
> > >
> > > 2015-07-28  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> > >
> > >         PR tree-optimization/66828
> > >         * tree-ssa-math-opts.c (perform_symbolic_merge): Change type
> > of
> > > inc
> > >         from int64_t to uint64_t.
> 
> Can I backport this change to GCC 5 branch? The patch applies cleanly on
> GCC 5 and shows no regression on a native x86_64-linux-gnu bootstrapped
> GCC and an arm-none-eabi GCC cross-compiler.

YEs.

> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index ba37d96..a301c23 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,3 +1,12 @@
> +2015-08-04  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> +
> +	Backport from mainline
> +	2015-07-28  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> +
> +	PR tree-optimization/66828
> +	* tree-ssa-math-opts.c (perform_symbolic_merge): Change type of inc
> +	from int64_t to uint64_t.
> +
>  2015-08-03  John David Anglin  <danglin@gcc.gnu.org>
>  
>  	PR target/67060
> diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
> index c22a677..c699dcadb 100644
> --- a/gcc/tree-ssa-math-opts.c
> +++ b/gcc/tree-ssa-math-opts.c
> @@ -1856,7 +1856,7 @@ perform_symbolic_merge (gimple source_stmt1, struct symbolic_number *n1,
>       the same base (array, structure, ...).  */
>    if (gimple_assign_rhs1 (source_stmt1) != gimple_assign_rhs1 (source_stmt2))
>      {
> -      int64_t inc;
> +      uint64_t inc;
>        HOST_WIDE_INT start_sub, end_sub, end1, end2, end;
>        struct symbolic_number *toinc_n_ptr, *n_end;
> 
> 
> Best regards,
> 
> Thomas
> 
> 
>
diff mbox

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ba37d96..a301c23 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@ 
+2015-08-04  Thomas Preud'homme  <thomas.preudhomme@arm.com>
+
+	Backport from mainline
+	2015-07-28  Thomas Preud'homme  <thomas.preudhomme@arm.com>
+
+	PR tree-optimization/66828
+	* tree-ssa-math-opts.c (perform_symbolic_merge): Change type of inc
+	from int64_t to uint64_t.
+
 2015-08-03  John David Anglin  <danglin@gcc.gnu.org>
 
 	PR target/67060
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index c22a677..c699dcadb 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -1856,7 +1856,7 @@  perform_symbolic_merge (gimple source_stmt1, struct symbolic_number *n1,
      the same base (array, structure, ...).  */
   if (gimple_assign_rhs1 (source_stmt1) != gimple_assign_rhs1 (source_stmt2))
     {
-      int64_t inc;
+      uint64_t inc;
       HOST_WIDE_INT start_sub, end_sub, end1, end2, end;
       struct symbolic_number *toinc_n_ptr, *n_end;