aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-07-18 13:39:28 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-07-18 13:39:28 +0000
commite002c7cbaff40445b05da1d5213cb8a08422fb9e (patch)
tree4a67ef0edc4087bb16956e1e1b5c1419eaff28d5 /gcc/testsuite
parentc1f5148401fd1afdc30a3b6d34257186376b98a6 (diff)
downloadgcc-e002c7cbaff40445b05da1d5213cb8a08422fb9e.zip
gcc-e002c7cbaff40445b05da1d5213cb8a08422fb9e.tar.gz
gcc-e002c7cbaff40445b05da1d5213cb8a08422fb9e.tar.bz2
expr.c (expand_expr_real_2): Properly truncate the BIT_NOT_EXPR expansion result to bitfield precision if...
2011-07-18 Richard Guenther <rguenther@suse.de> * expr.c (expand_expr_real_2): Properly truncate the BIT_NOT_EXPR expansion result to bitfield precision if required. * gcc.dg/torture/20110718-1.c: New testcase. From-SVN: r176398
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/torture/20110718-1.c23
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 65125bd..32f59bd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2011-07-18 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/torture/20110718-1.c: New testcase.
+
2011-07-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* g++.dg/ext/bitfield2.C: Remove i?86-*-netware support.
diff --git a/gcc/testsuite/gcc.dg/torture/20110718-1.c b/gcc/testsuite/gcc.dg/torture/20110718-1.c
new file mode 100644
index 0000000..ccabbd9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/20110718-1.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+
+extern void abort (void);
+struct X {
+#if (__SIZEOF_LONG__ != __SIZEOF_INT__) && (__SIZEOF_LONG__ == 8)
+ unsigned long i : 33;
+#else
+ unsigned long i;
+#endif
+};
+unsigned long __attribute__((noinline))
+foo (struct X *p)
+{
+ return ~p->i;
+}
+int main()
+{
+ struct X x;
+ x.i = -1;
+ if (foo (&x) != 0)
+ abort ();
+ return 0;
+}