PR middle-end/37882
* fold-const.c (build_range_type): For 1 .. signed_max
range call build_nonstandard_inter_type if signed_type_for
returned a type with bigger precision.
* gcc.c-torture/execute/pr37882.c: New test.
From-SVN: r141303
+2008-10-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/37882
+ * fold-const.c (build_range_type): For 1 .. signed_max
+ range call build_nonstandard_inter_type if signed_type_for
+ returned a type with bigger precision.
+
2008-10-22 Richard Guenther <rguenther@suse.de>
* tree.def (COMPLEX_TYPE): Constrain element type.
{
if (TYPE_UNSIGNED (etype))
{
- etype = signed_type_for (etype);
+ tree signed_etype = signed_type_for (etype);
+ if (TYPE_PRECISION (signed_etype) != TYPE_PRECISION (etype))
+ etype
+ = build_nonstandard_integer_type (TYPE_PRECISION (etype), 0);
+ else
+ etype = signed_etype;
exp = fold_convert (etype, exp);
}
return fold_build2 (GT_EXPR, type, exp,
+2008-10-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/37882
+ * gcc.c-torture/execute/pr37882.c: New test.
+
2008-10-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/30949
--- /dev/null
+/* PR middle-end/37882 */
+
+struct S
+{
+ int a : 21;
+ unsigned char b : 3;
+} s;
+
+int
+main ()
+{
+ s.b = 4;
+ if (s.b > 0 && s.b < 4)
+ __builtin_abort ();
+ return 0;
+}