1 2010-07-07 Jakub Jelinek <jakub@redhat.com>
3 * tree-sra.c (sra_build_assignment): Don't add BIT_XOR_EXPR/MINUS_EXPR
4 of signbit if signbit is the most significant bit of utype already.
6 * gcc.c-torture/execute/20100707-1.c: New test.
8 --- gcc/tree-sra.c.jj 2010-05-13 13:08:52.000000000 +0200
9 +++ gcc/tree-sra.c 2010-07-06 19:50:09.000000000 +0200
10 @@ -2211,7 +2211,10 @@ sra_build_assignment (tree dst, tree src
12 /* Perform sign extension, if required.
13 ??? This should never be necessary. */
16 + && (TREE_INT_CST_LOW (width) != TYPE_PRECISION (utype)
17 + || (TREE_INT_CST_LOW (width)
18 + != GET_MODE_BITSIZE (TYPE_MODE (utype)))))
20 tree signbit = int_const_binop (LSHIFT_EXPR,
21 build_int_cst_wide (utype, 1, 0),
22 --- gcc/testsuite/gcc.c-torture/execute/20100707-1.c 2010-05-27 15:41:40.446237053 +0200
23 +++ gcc/testsuite/gcc.c-torture/execute/20100707-1.c 2010-07-06 13:55:35.000000000 +0200
26 +struct T { int w; int h; };
30 +bar (const struct S * x)
38 +__attribute__ ((noinline))
39 +void foo (struct S * w, unsigned char *x, int y, int *z[2])
45 + for (i = 0; i <= t.h; i++)
47 + int *u = z[i > 0] + 1;
51 + for (j = 0; j < t.w; j++)
54 + if (m > y && !q && v[j - k] != 2)
67 + __builtin_memset (v, 0, sizeof (v));
72 + foo (&s, b + 32, -1, z);