summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorjingyu <jingyu@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-15 21:54:01 +0000
committerjingyu <jingyu@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-15 21:54:01 +0000
commit92c624a375e7b7a3af1cc5da0a473bacdf046692 (patch)
tree58ebeac6f70fabacbde6abba8c1de445738f945e /gcc/testsuite/gcc.c-torture
parent9b464fe51fcd8443d5c62831df4ae3e9b8eee627 (diff)
downloadgcc-92c624a375e7b7a3af1cc5da0a473bacdf046692.tar.gz
2010-01-15 Jing Yu <jingyu@google.com>
PR rtl-optimization/42691 * combine.c (try_combine): Set changed_i3_dest to 1 when I2 and I3 set a pseudo to a constant and are merged, and adjust comments. 2010-01-15 Jing Yu <jingyu@google.com> PR rtl-optimization/42691 * gcc.c-torture/execute/pr42691.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155948 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr42691.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr42691.c b/gcc/testsuite/gcc.c-torture/execute/pr42691.c
new file mode 100644
index 00000000000..7eeee99ec2f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr42691.c
@@ -0,0 +1,41 @@
+extern void abort (void);
+
+union _D_rep
+{
+ unsigned short rep[4];
+ double val;
+};
+
+int add(double* key, double* table)
+{
+ unsigned i = 0;
+ double* deletedEntry = 0;
+ while (1) {
+ double* entry = table + i;
+
+ if (*entry == *key)
+ break;
+
+ union _D_rep _D_inf = {{ 0, 0, 0, 0x7ff0 }};
+ if (*entry != _D_inf.val)
+ abort ();
+
+ union _D_rep _D_inf2 = {{ 0, 0, 0, 0x7ff0 }};
+ if (!_D_inf2.val)
+ deletedEntry = entry;
+
+ i++;
+ }
+ if (deletedEntry)
+ *deletedEntry = 0.0;
+ return 0;
+}
+
+int main ()
+{
+ union _D_rep infinit = {{ 0, 0, 0, 0x7ff0 }};
+ double table[2] = { infinit.val, 23 };
+ double key = 23;
+ int ret = add (&key, table);
+ return ret;
+}