public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PR68474: Fix tree-call-cdce.c:use_internal_fn
@ 2015-12-01  9:25 Richard Sandiford
  2015-12-01 10:53 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2015-12-01  9:25 UTC (permalink / raw)
  To: gcc-patches

We'd call gen_shrink_wrap_conditions for functions that it can't handle
but edom_only_function can.

Tested on x86_64-linux-gnu.  OK to install?

Thanks,
Richard


gcc/
	PR tree-optimization/68474
	* tree-call-cdce.c (use_internal_fn): Protect call to
	gen_shrink_wrap_conditions.

gcc/testsuite/
	PR tree-optimization/68474
	* gcc.dg/pr68474.c: New test.

diff --git a/gcc/testsuite/gcc.dg/pr68474.c b/gcc/testsuite/gcc.dg/pr68474.c
new file mode 100644
index 0000000..8ad7def
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr68474.c
@@ -0,0 +1,7 @@
+/* { dg-options "-O -funsafe-math-optimizations" } */
+
+long double
+foo (long double d1, long double d2)
+{
+  return d1 || __builtin_significandl (d2);
+}
diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c
index 75ef180..4123130 100644
--- a/gcc/tree-call-cdce.c
+++ b/gcc/tree-call-cdce.c
@@ -959,7 +959,8 @@ use_internal_fn (gcall *call)
 {
   unsigned nconds = 0;
   auto_vec<gimple *, 12> conds;
-  gen_shrink_wrap_conditions (call, conds, &nconds);
+  if (can_test_argument_range (call))
+    gen_shrink_wrap_conditions (call, conds, &nconds);
   if (nconds == 0 && !edom_only_function (call))
     return false;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PR68474: Fix tree-call-cdce.c:use_internal_fn
  2015-12-01  9:25 PR68474: Fix tree-call-cdce.c:use_internal_fn Richard Sandiford
@ 2015-12-01 10:53 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2015-12-01 10:53 UTC (permalink / raw)
  To: GCC Patches, richard.sandiford

On Tue, Dec 1, 2015 at 10:24 AM, Richard Sandiford
<richard.sandiford@arm.com> wrote:
> We'd call gen_shrink_wrap_conditions for functions that it can't handle
> but edom_only_function can.
>
> Tested on x86_64-linux-gnu.  OK to install?

Ok.

Richard.

> Thanks,
> Richard
>
>
> gcc/
>         PR tree-optimization/68474
>         * tree-call-cdce.c (use_internal_fn): Protect call to
>         gen_shrink_wrap_conditions.
>
> gcc/testsuite/
>         PR tree-optimization/68474
>         * gcc.dg/pr68474.c: New test.
>
> diff --git a/gcc/testsuite/gcc.dg/pr68474.c b/gcc/testsuite/gcc.dg/pr68474.c
> new file mode 100644
> index 0000000..8ad7def
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/pr68474.c
> @@ -0,0 +1,7 @@
> +/* { dg-options "-O -funsafe-math-optimizations" } */
> +
> +long double
> +foo (long double d1, long double d2)
> +{
> +  return d1 || __builtin_significandl (d2);
> +}
> diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c
> index 75ef180..4123130 100644
> --- a/gcc/tree-call-cdce.c
> +++ b/gcc/tree-call-cdce.c
> @@ -959,7 +959,8 @@ use_internal_fn (gcall *call)
>  {
>    unsigned nconds = 0;
>    auto_vec<gimple *, 12> conds;
> -  gen_shrink_wrap_conditions (call, conds, &nconds);
> +  if (can_test_argument_range (call))
> +    gen_shrink_wrap_conditions (call, conds, &nconds);
>    if (nconds == 0 && !edom_only_function (call))
>      return false;
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-01 10:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01  9:25 PR68474: Fix tree-call-cdce.c:use_internal_fn Richard Sandiford
2015-12-01 10:53 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).