Patchwork Fix PR tree-optimization/49170

login
register
mail settings
Submitter William J. Schmidt
Date May 27, 2011, 12:06 p.m.
Message ID <1306497969.6103.6.camel@gnopaine>
Download mbox | patch
Permalink /patch/97671/
State New
Headers show

Comments

William J. Schmidt - May 27, 2011, 12:06 p.m.
Rainer has verified the following patch fixes the problem he observed in
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49170.  OK to commit?


2011-05-27  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/49170
	* tree-ssa-math-opts.c (execute_cse_sincos):  Add checks for
	sincos or cexp.
Richard Guenther - May 27, 2011, 1:11 p.m.
On Fri, May 27, 2011 at 2:06 PM, William J. Schmidt
<wschmidt@linux.vnet.ibm.com> wrote:
> Rainer has verified the following patch fixes the problem he observed in
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49170.  OK to commit?

Ok.

Thanks,
Richard.

>
> 2011-05-27  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
>
>        PR tree-optimization/49170
>        * tree-ssa-math-opts.c (execute_cse_sincos):  Add checks for
>        sincos or cexp.
>
>
>
> Index: tree-ssa-math-opts.c
> ===================================================================
> --- tree-ssa-math-opts.c    (revision 174277)
> +++ tree-ssa-math-opts.c    (working copy)
> @@ -1093,6 +1093,10 @@ execute_cse_sincos (void)
>         CASE_FLT_FN (BUILT_IN_COS):
>         CASE_FLT_FN (BUILT_IN_SIN):
>         CASE_FLT_FN (BUILT_IN_CEXPI):
> +          /* Make sure we have either sincos or cexp.  */
> +          if (!TARGET_HAS_SINCOS && !TARGET_C99_FUNCTIONS)
> +            break;
> +
>           arg = gimple_call_arg (stmt, 0);
>           if (TREE_CODE (arg) == SSA_NAME)
>             cfg_changed |= execute_cse_sincos_1 (arg);
>
>

Patch

Index: tree-ssa-math-opts.c
===================================================================
--- tree-ssa-math-opts.c    (revision 174277)
+++ tree-ssa-math-opts.c    (working copy)
@@ -1093,6 +1093,10 @@  execute_cse_sincos (void)
         CASE_FLT_FN (BUILT_IN_COS):
         CASE_FLT_FN (BUILT_IN_SIN):
         CASE_FLT_FN (BUILT_IN_CEXPI):
+          /* Make sure we have either sincos or cexp.  */
+          if (!TARGET_HAS_SINCOS && !TARGET_C99_FUNCTIONS)
+            break;
+
           arg = gimple_call_arg (stmt, 0);
           if (TREE_CODE (arg) == SSA_NAME)
             cfg_changed |= execute_cse_sincos_1 (arg);