re PR rtl-optimization/23241 (Invalid code generated for comparison of uchar to 255)
authorJosh Conner <jconner@apple.com>
Mon, 8 Aug 2005 18:28:46 +0000 (18:28 +0000)
committerJosh Conner <jconner@gcc.gnu.org>
Mon, 8 Aug 2005 18:28:46 +0000 (18:28 +0000)
PR rtl-optimization/23241
* gcc.dg/char-compare.c: New test.

From-SVN: r102868

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/char-compare.c [new file with mode: 0644]

index 4a79bf8261e33fdd9c272459a5c01f20c767de94..c45105e21346c3dc730fe0a9e97242310f05f1ec 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-08  Josh Conner  <jconner@apple.com>
+
+       PR rtl-optimization/23241
+       * gcc.dg/char-compare.c: New test.
+
 2005-08-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/22508
diff --git a/gcc/testsuite/gcc.dg/char-compare.c b/gcc/testsuite/gcc.dg/char-compare.c
new file mode 100644 (file)
index 0000000..f8b2fb9
--- /dev/null
@@ -0,0 +1,23 @@
+/* PR rtl-optimization/23241 */
+/* Origin: Josh Conner <jconner@apple.com> */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort(void);
+
+struct fbs {
+  unsigned char uc;
+} fbs1 = {255};
+
+void fn(struct fbs *fbs_ptr)
+{
+  if ((fbs_ptr->uc != 255) && (fbs_ptr->uc != 0))
+    abort();
+}
+
+int main(void)
+{
+  fn(&fbs1); 
+  return 0;
+}