aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2005-11-09 21:34:31 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2005-11-09 21:34:31 +0000
commitc8e90f4053f0e366630c5147d28d4d9c56e56668 (patch)
treeca883f3b1639764277c88f95e1f44f59c48c0459 /gcc/testsuite/gcc.dg
parent7ef67393c7454bb93a070d0290b4196c06a93ce8 (diff)
downloadgcc-c8e90f4053f0e366630c5147d28d4d9c56e56668.zip
gcc-c8e90f4053f0e366630c5147d28d4d9c56e56668.tar.gz
gcc-c8e90f4053f0e366630c5147d28d4d9c56e56668.tar.bz2
ifcvt.c (noce_get_alt_condition): Use prev_nonnote_insn.
* ifcvt.c (noce_get_alt_condition): Use prev_nonnote_insn. (noce_try_abs): Negate if the comparison is reversed. Look only one instruction backwards for a REG_EQUAL note. From-SVN: r106706
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/ifcvt-fabs-1.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ifcvt-fabs-1.c b/gcc/testsuite/gcc.dg/ifcvt-fabs-1.c
new file mode 100644
index 0000000..6808a8f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ifcvt-fabs-1.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O" } */
+/* { dg-options "-O -march=i686" { target i686-*-* } } */
+
+extern void abort(void);
+
+float foo(float f)
+{
+ if (f < 0.0f)
+ f = -f;
+
+ return f;
+}
+
+int main(void)
+{
+ if (foo (-1.0f) != 1.0f)
+ abort ();
+
+ return 0;
+}