+2011-02-11 Xinliang David Li <davidxl@google.com>
+
+ PR tree-optimization/47707
+ * tree-chrec.c (convert_affine_scev): Keep type precision.
+
2011-02-11 Eric Botcazou <ebotcazou@adacore.com>
PR tree-optimization/47420
+2011-02-11 Xinliang David Li <davidxl@google.com>
+
+ PR tree-optimization/47707
+ * g++.dg/tree-ssa/pr47707.C: New test.
+
2011-02-11 Eric Botcazou <ebotcazou@adacore.com>
* g++.dg/opt/inline17.C: New test.
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-tree-vrp" } */
+#include <assert.h>
+
+struct CH
+{
+ unsigned char ch : 3;
+} ch;
+
+__attribute__((noinline)) void MakeCheckOp (unsigned int *v1, unsigned int *v2)
+{
+ assert (*v1 == *v2);
+
+}
+
+int main (void)
+{
+
+ int len;
+
+ for (len = 4; len >= 1; len--)
+ {
+ unsigned v1, v2;
+ ch.ch = len;
+ v1 = ch.ch;
+ v2 = len;
+ MakeCheckOp (&v1, &v2);
+ }
+}
performed by default when CT is signed. */
new_step = *step;
if (TYPE_PRECISION (step_type) > TYPE_PRECISION (ct) && TYPE_UNSIGNED (ct))
- new_step = chrec_convert_1 (signed_type_for (ct), new_step, at_stmt,
- use_overflow_semantics);
+ {
+ tree signed_ct = build_nonstandard_integer_type (TYPE_PRECISION (ct), 0);
+ new_step = chrec_convert_1 (signed_ct, new_step, at_stmt,
+ use_overflow_semantics);
+ }
new_step = chrec_convert_1 (step_type, new_step, at_stmt, use_overflow_semantics);
if (automatically_generated_chrec_p (new_base)
return false;
}
}
-