On Wed, Mar 12, 2014 at 11:45:03AM +0800, Thomas Preud'homme wrote:
> > From: Jakub Jelinek [mailto:ja...@redhat.com]
> >
> > In theory you could have __CHAR_BIT__ different from 8 and what you care
> > about is that uint32_t has exactly 32 bits, so the check would need to be
> > if (sizeof (uin
On Wed, Mar 12, 2014 at 11:43:00AM +0800, Joey Ye wrote:
> 4.8 also has this bug. OK to backport?
Yes.
Jakub
> From: Jakub Jelinek [mailto:ja...@redhat.com]
>
> In theory you could have __CHAR_BIT__ different from 8 and what you care
> about is that uint32_t has exactly 32 bits, so the check would need to be
> if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
> return 0;
I could go with:
In = (0x12 <<
4.8 also has this bug. OK to backport?
On Tue, Mar 11, 2014 at 6:59 PM, Jakub Jelinek wrote:
> On Tue, Mar 11, 2014 at 06:48:37PM +0800, Thomas Preud'homme wrote:
>> I also added a typedef unsigned uint32_t for when sizeof(unsigned) == 4. I
>> hope it's right.
>
> In theory you could have __CHAR
On 03/11/14 03:48, Thomas Preud'homme wrote:
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 748805e..b6d7d93 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-07 Thomas Preud'homme
+
+ PR tree-optimization/60454
+ * tree-ssa-math-opts.c (find_bswap_1): Fix
On Tue, Mar 11, 2014 at 06:48:37PM +0800, Thomas Preud'homme wrote:
> I also added a typedef unsigned uint32_t for when sizeof(unsigned) == 4. I
> hope it's right.
In theory you could have __CHAR_BIT__ different from 8 and what you care
about is that uint32_t has exactly 32 bits, so the check wou
> From: Jakub Jelinek [mailto:ja...@redhat.com]
>
> The ChangeLog entry is wrong, the file is new, so you should just say:
> * gcc.c-torture/execute/pr60454.c: New test.
Done.
>
> But more importantly:
>
> > --- /dev/null
> > +++ b/gcc/testsuite/gcc.c-torture/execute/pr60454.c
> > @@ -0,
On Tue, Mar 11, 2014 at 02:53:39PM +0800, Thomas Preud'homme wrote:
> +2014-03-10 Thomas Preud'homme
> +
> + PR tree-optimization/60454
> + * gcc.c-torture/execute/pr60454.c (fake_swap32): Testcase to track
> + regression of PR60454.
The ChangeLog entry is wrong, the file is new, so
> From: Jakub Jelinek [mailto:ja...@redhat.com]
> > n->size = n1.size;
> > + for (i = 0, mask = 0xff; i < n->size; i++, mask <<= 8)
>
> This should be mask <<= BITS_PER_UNIT for consistency.
Indeed.
>
> And, as has been said earlier, the testcase should be a runtime testcase
> (in gcc
Hi!
On Fri, Mar 07, 2014 at 05:35:01PM +0800, Thomas Preud'homme wrote:
> --- a/gcc/tree-ssa-math-opts.c
> +++ b/gcc/tree-ssa-math-opts.c
> @@ -1801,7 +1801,9 @@ find_bswap_1 (gimple stmt, struct symbolic_number *n,
> int limit)
>
>if (rhs_class == GIMPLE_BINARY_RHS)
> {
> + int i
On Fri, Mar 7, 2014 at 12:45 PM, Marcus Shawcroft
wrote:
> On 7 March 2014 09:35, Thomas Preud'homme wrote:
>
>> +++ b/gcc/testsuite/gcc.dg/optimize-bswapsi-2.c
>> @@ -0,0 +1,26 @@
>> +/* { dg-do compile { target arm*-*-* alpha*-*-* i?86-*-* powerpc*-*-*
>> rs6000-*-* x86_64-*-* s390*-*-* } } */
On 7 March 2014 09:35, Thomas Preud'homme wrote:
> +++ b/gcc/testsuite/gcc.dg/optimize-bswapsi-2.c
> @@ -0,0 +1,26 @@
> +/* { dg-do compile { target arm*-*-* alpha*-*-* i?86-*-* powerpc*-*-*
> rs6000-*-* x86_64-*-* s390*-*-* } } */
I'm fairly sure the target list here should include aarch64*-*-
The bswap optimization has a bug where a code can be incorrectly detected as
doing a byte swap, therefore leading to change of behavior for the program
compiled. This is tracked as PR60454. The patch below fixes the issue.
Best regards,
Thomas Preud'homme
diff --git a/gcc/ChangeLog b/gcc/Chang
13 matches
Mail list logo