aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2007-08-26 18:24:19 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2007-08-26 11:24:19 -0700
commit6d46783956d60c60f81191373194a2949faaf0af (patch)
treee608cbb4dca3385e3627ee2e91f2ecdf14351056 /gcc/testsuite
parent75be5dc0a1ae68106d1a047d0c0c8fada4bfec8c (diff)
downloadgcc-6d46783956d60c60f81191373194a2949faaf0af.zip
gcc-6d46783956d60c60f81191373194a2949faaf0af.tar.gz
gcc-6d46783956d60c60f81191373194a2949faaf0af.tar.bz2
re PR middle-end/33181 (Revision 127766 generates bad cmov)
gcc/ 2007-08-26 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/33181 * ifcvt.c (noce_get_alt_condition): Make sure that the previous non NOTE insn doesn't cross basic block. (noce_try_abs): Likewise. (noce_process_if_block): Likewise. gcc/testsuite/ 2007-08-26 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/33181 * gcc.dg/ifelse-2.c: New. From-SVN: r127810
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/ifelse-2.c34
2 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8dbd4c2..ae2f57b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/33181
+ * gcc.dg/ifelse-2.c: New.
+
2007-08-26 Tobias Burnus <burnus@net-b.de>
PR fortran/32980
diff --git a/gcc/testsuite/gcc.dg/ifelse-2.c b/gcc/testsuite/gcc.dg/ifelse-2.c
new file mode 100644
index 0000000..0210fcf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ifelse-2.c
@@ -0,0 +1,34 @@
+/*
+{ dg-do run }
+{ dg-options "-O2" }
+*/
+
+extern void abort (void);
+
+enum Status
+{
+ P_ON_LOWER = -4,
+ P_ON_UPPER = -2,
+ P_FREE = -1
+};
+
+void
+foo (enum Status *stat, double newUpper, double lower, double max)
+{
+ if (newUpper >= max)
+ *stat = P_FREE;
+ else if (newUpper == lower)
+ *stat = P_ON_LOWER;
+}
+
+int
+main ()
+{
+ enum Status stat = P_ON_UPPER;
+
+ foo (&stat, 5.0, -10.0, 10.0);
+
+ if (stat != P_ON_UPPER)
+ abort ();
+ return 0;
+}