]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Sun, 7 Mar 2004 02:48:04 +0000 (02:48 +0000)
committerNo Author <no-author@gcc.gnu.org>
Sun, 7 Mar 2004 02:48:04 +0000 (02:48 +0000)
'gcc-3_3-branch'.

From-SVN: r79048

gcc/testsuite/gcc.c-torture/compile/20040304-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/20040306-1.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.c-torture/compile/20040304-1.c b/gcc/testsuite/gcc.c-torture/compile/20040304-1.c
new file mode 100644 (file)
index 0000000..146d42f
--- /dev/null
@@ -0,0 +1,45 @@
+/* PR optimization/14235 */
+/* Origin: <senor_fjord@yahoo.com> */
+
+typedef signed char        int8_t;
+typedef short              int16_t;
+typedef int                int32_t;
+typedef unsigned long long uint64_t;
+
+static const uint64_t LOW_BYTE_MASK    = 0x00000000000000ffULL;
+static const uint64_t HIGH_BYTE_MASK   = 0x000000000000ff00ULL;
+static const uint64_t WORD_MASK        = 0x000000000000ffffULL;
+static const uint64_t DWORD_MASK       = 0x00000000ffffffffULL;
+
+extern uint64_t *srca_mask;
+extern int *assert_thrown;
+
+void foo()
+{
+  uint64_t tempA = 0; /* actually a bunch of code to set A */ 
+  uint64_t tempB = 0; /* actually a bunch of code to set B */ 
+
+  /* cast A to right size */
+  tempA = (((*srca_mask == LOW_BYTE_MASK) || 
+            (*srca_mask == HIGH_BYTE_MASK)) ?
+           ((int8_t)tempA) : 
+           ((*srca_mask == WORD_MASK) ? 
+            ((int16_t)tempA) : 
+            ((*srca_mask == DWORD_MASK) ? 
+             ((int32_t)tempA) : 
+             tempA)));
+
+  /* cast B to right size */
+  tempB = (((*srca_mask == LOW_BYTE_MASK) || 
+            (*srca_mask == HIGH_BYTE_MASK)) ? 
+           ((int8_t)tempB) : 
+           ((*srca_mask == WORD_MASK) ? 
+            ((int16_t)tempB) : 
+            ((*srca_mask == DWORD_MASK) ? 
+             ((int32_t)tempB) : 
+             tempB))); 
+    
+  if ((int) tempA > (int) tempB) { 
+    *assert_thrown = 1;
+  }
+}
diff --git a/gcc/testsuite/gcc.dg/20040306-1.c b/gcc/testsuite/gcc.dg/20040306-1.c
new file mode 100644 (file)
index 0000000..903d20a
--- /dev/null
@@ -0,0 +1,22 @@
+/* This used to ICE due to a reload bug on s390*.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+
+typedef struct test
+{
+  unsigned short pad;
+  unsigned char type[6];
+} t;
+
+extern void set (t *a, t *b, t *c, t *d, t *e, t *f, t *g, t *h, 
+                t *i, t *j, t *k, t *l, t *m, t *n, t *o, t *p);
+extern void use (t a, t b, t c, t d, t e, t f, t g, t h,
+                t i, t j, t k, t l, t m, t n, t o, t p);
+void test (void)
+{
+    t a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p;
+    set (&a, &b, &c, &d, &e, &f, &g, &h, &i, &j, &k, &l, &m, &n, &o, &p);
+    use (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p);
+}