+2005-12-26 Kazu Hirata <kazu@codesourcery.com>
+
+ PR tree-optimization/25125
+ * convert.c (convert_to_integer): Don't narrow the type of a
+ PLUX_EXPR or MINUS_EXPR if !flag_wrapv and the unwidened type
+ is signed.
+
2005-12-26 Graham Stott <graham.stott@btinternet.com>
PR middle-end/25568
|| ex_form == RSHIFT_EXPR
|| ex_form == LROTATE_EXPR
|| ex_form == RROTATE_EXPR))
- || ex_form == LSHIFT_EXPR)
+ || ex_form == LSHIFT_EXPR
+ /* If we have !flag_wrapv, and either ARG0 or
+ ARG1 is of a signed type, we have to do
+ PLUS_EXPR or MINUS_EXPR in an unsigned
+ type. Otherwise, we would introduce
+ signed-overflow undefinedness. */
+ || (!flag_wrapv
+ && (ex_form == PLUS_EXPR
+ || ex_form == MINUS_EXPR)
+ && (!TYPE_UNSIGNED (TREE_TYPE (arg0))
+ || !TYPE_UNSIGNED (TREE_TYPE (arg1)))))
typex = lang_hooks.types.unsigned_type (typex);
else
typex = lang_hooks.types.signed_type (typex);
+2005-12-26 Kazu Hirata <kazu@codesourcery.com>
+
+ PR tree-optimization/25125
+ * gcc.dg/vect/vect-7.c, gcc.dg/vect/vect-reduc-2char.c,
+ gcc.dg/vect/vect-reduc-2short.c: XFAIL.
+ * gcc.c-torture/execute/pr25125.c: New.
+
2005-12-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25029
--- /dev/null
+extern void exit (int);
+extern void abort (void);
+extern unsigned short f (short a) __attribute__((__noinline__));
+
+unsigned short
+f (short a)
+{
+ short b;
+
+ if (a > 0)
+ return 0;
+ b = ((int) a) + - (int) 32768;
+ return b;
+}
+
+int
+main (void)
+{
+ if (sizeof (short) < 2
+ || sizeof (short) >= sizeof (int))
+ exit (0);
+
+ if (f (-32767) != 1)
+ abort ();
+
+ exit (0);
+}
}
/* Fails for 32-bit targets that don't vectorize PLUS. */
-/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */