summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr23049.c
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-04 05:57:38 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-04 05:57:38 +0000
commit63315c52134b81242ec74c4e60ddc158cff37b5c (patch)
tree7151af0afa8919a5d3d55f199b5534c2e0dbb2eb /gcc/testsuite/gcc.dg/pr23049.c
parent43a42807564cfdaf0ee6789e22aa7af780a02375 (diff)
downloadgcc-63315c52134b81242ec74c4e60ddc158cff37b5c.tar.gz
2005-10-05 Steven Bosscher <stevenb@suse.de>
gcc/ PR tree-optimization/23049 * tree-ssa-dom.c (thread_across_edge): Make sure that the condition of a COND_EXPR is folded before calling fold on the whole rhs of a conditional assignment. * doc/tree-ssa.texi: Update the GIMPLE grammar for a valid rhs to document that a COND_EXPR may appear there. testsuite/ * gcc.dg/pr23049.c: New test. * gcc.dg/ucnid-4.c: Fix test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104938 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr23049.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr23049.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr23049.c b/gcc/testsuite/gcc.dg/pr23049.c
new file mode 100644
index 00000000000..0a71cecb217
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr23049.c
@@ -0,0 +1,26 @@
+/* This was an ICE in fold where we tried to fold something like,
+
+ a = 0 == 0 ? 0 : 3988292384
+
+ after doing if-conversion for the vectorizer. Folding "0 == 0"
+ should have been done before calling fold on the whole rhs of
+ the above expression. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftree-vectorize" } */
+
+static unsigned short int crc_table[256];
+void AC3_encode_init(void)
+{
+ unsigned int c, n, k;
+ for(n=0; n<256; n++)
+ {
+ c = n << 8;
+ for (k = 0; k < 8; k++)
+ {
+ if (c & (1 << 15))
+ c = ((c << 1) & 0xffff) ^ (((1 << 0) | (1 << 2) | (1 << 15) | (1 << 16)) & 0xffff);
+ }
+ crc_table[n] = c;
+ }
+}