+2008-04-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/36017
+ * builtins.c (expand_errno_check): Clear CALL_EXPR_TAILCALL before
+ expanding the library call.
+
2008-04-22 Ian Lance Taylor <iant@google.com>
* fold-const.c (pointer_may_wrap_p): Call int_size_in_bytes rather
}
#endif
+ /* Make sure the library call isn't expanded as a tail call. */
+ CALL_EXPR_TAILCALL (exp) = 0;
+
/* We can't set errno=EDOM directly; let the library call do it.
Pop the arguments right away in case the call gets deleted. */
NO_DEFER_POP;
+2008-04-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/36017
+ * gcc.dg/pr36017.c: New test.
+
2008-04-22 Jakub Jelinek <jakub@redhat.com>
PR c++/35747
--- /dev/null
+/* PR rtl-optimization/36017 */
+/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */
+/* { dg-options "-O2 -lm" } */
+
+extern double sqrt (double);
+extern void abort (void);
+
+__attribute__((noinline)) double
+foo (double a)
+{
+ double b, c, d = 0.7;
+ if (a <= d)
+ b = sqrt (d * a);
+ else
+ {
+ c = (1.0 - d) * (1.0 - a);
+ b = c > 0 ? 1.0 - sqrt (c) : 1.0;
+ }
+ return b;
+}
+
+int
+main (void)
+{
+ double c = foo (0.5);
+ if (c > 0.5917)
+ abort ();
+ return 0;
+}