diff mbox

[gomp4] Adjust UNQUE ifn

Message ID 562E382D.1010700@acm.org
State New
Headers show

Commit Message

Nathan Sidwell Oct. 26, 2015, 2:26 p.m. UTC
On 10/26/15 02:10, Thomas Schwinge wrote:
> Hi Nathan!
  }
>
>      [...]/source-gcc/gcc/internal-fn.c: In function 'void expand_UNIQUE(gcall*)':
>      [...]/source-gcc/gcc/internal-fn.c:1982:6: error: variable 'target' set but not used [-Werror=unused-but-set-variable]
>        rtx target = const0_rtx;
>            ^
>      [...]/source-gcc/gcc/internal-fn.c:1987:6: error: unused variable 'data_dep' [-Werror=unused-variable]
>        rtx data_dep = expand_normal (gimple_call_arg (stmt, 1));
>            ^
>      [...]/source-gcc/gcc/internal-fn.c:1988:6: error: unused variable 'axis' [-Werror=unused-variable]
>        rtx axis = expand_normal (gimple_call_arg (stmt, 2));


Fixed thusly.

nathan

Comments

Richard Biener Oct. 26, 2015, 2:36 p.m. UTC | #1
On Mon, Oct 26, 2015 at 3:26 PM, Nathan Sidwell <nathan@acm.org> wrote:
> On 10/26/15 02:10, Thomas Schwinge wrote:
>>
>> Hi Nathan!
>
>  }
>>
>>
>>      [...]/source-gcc/gcc/internal-fn.c: In function 'void
>> expand_UNIQUE(gcall*)':
>>      [...]/source-gcc/gcc/internal-fn.c:1982:6: error: variable 'target'
>> set but not used [-Werror=unused-but-set-variable]
>>        rtx target = const0_rtx;
>>            ^
>>      [...]/source-gcc/gcc/internal-fn.c:1987:6: error: unused variable
>> 'data_dep' [-Werror=unused-variable]
>>        rtx data_dep = expand_normal (gimple_call_arg (stmt, 1));
>>            ^
>>      [...]/source-gcc/gcc/internal-fn.c:1988:6: error: unused variable
>> 'axis' [-Werror=unused-variable]
>>        rtx axis = expand_normal (gimple_call_arg (stmt, 2));
>
>
>
> Fixed thusly.

Looks better now.

+         {
 #ifdef HAVE_oacc_fork

(etc.)  can you use target-insn.def and targetm.have_oacc_fork () instead?

> nathan
Nathan Sidwell Oct. 26, 2015, 2:42 p.m. UTC | #2
On 10/26/15 07:36, Richard Biener wrote:

> +         {
>   #ifdef HAVE_oacc_fork
>
> (etc.)  can you use target-insn.def and targetm.have_oacc_fork () instead?

I can try ...


nathan
diff mbox

Patch

2015-10-26  Nathan Sidwell  <nathan@codesourcery.com>

	* internal-fn.c (expand_UNIQUE): Protect fork & join inside
	combined if defined.

Index: gcc/internal-fn.c
===================================================================
--- gcc/internal-fn.c	(revision 229297)
+++ gcc/internal-fn.c	(working copy)
@@ -1978,6 +1978,7 @@  expand_UNIQUE (gcall *stmt)
     case IFN_UNIQUE_OACC_FORK:
     case IFN_UNIQUE_OACC_JOIN:
       {
+#if defined (HAVE_oacc_fork) && defined (HAVE_oacc_join)
 	tree lhs = gimple_call_lhs (stmt);
 	rtx target = const0_rtx;
 
@@ -1988,21 +1989,12 @@  expand_UNIQUE (gcall *stmt)
 	rtx axis = expand_normal (gimple_call_arg (stmt, 2));
 
 	if (code == IFN_UNIQUE_OACC_FORK)
-	  {
-#ifdef HAVE_oacc_fork
-	    pattern = gen_oacc_fork (target, data_dep, axis);
-#else
-	    gcc_unreachable ();
-#endif
-	  }
+	  pattern = gen_oacc_fork (target, data_dep, axis);
 	else
-	  {
-#ifdef HAVE_oacc_join
-	    pattern = gen_oacc_join (target, data_dep, axis);
+	  pattern = gen_oacc_join (target, data_dep, axis);
 #else
-	    gcc_unreachable ();
+	gcc_unreachable ();
 #endif
-	  }
       }
       break;
     }