diff mbox

[PR60467,Cilk+] Fix for ICE with incorrect Cilk_spawn usage

Message ID 0EFAB2BDD0F67E4FB6CCC8B9F87D7569429DC101@IRSMSX103.ger.corp.intel.com
State New
Headers show

Commit Message

Zamyatin, Igor April 10, 2014, 2:20 p.m. UTC
Resending with correct Changelog. 

Is it OK?

Thanks,
Igor

gcc/c-family/ChangeLog:

2014-04-10  Igor Zamyatin  <igor.zamyatin@intel.com>

      PR middle-end/60467
      * cilk.c (cilk_set_spawn_marker): Remove FUNCTION_DECL
      as possible argument for Cilk_spawn.

gcc/testsuite/ChangeLog:

2014-04-10  Igor Zamyatin  <igor.zamyatin@intel.com>

      PR middle-end/60467
      * c-c++-common/cilk-plus/CK/invalid_spawns.c: Add new invalid
      case to check.


> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Zamyatin, Igor
> Sent: Thursday, April 10, 2014 5:55 PM
> To: GCC Patches (gcc-patches@gcc.gnu.org)
> Cc: Iyer, Balaji V; Jakub Jelinek (jakub@redhat.com)
> Subject: [PATCH, PR60467, Cilk+] Fix for ICE with incorrect Cilk_spawn usage
> 
> Hi!
> 
> This patch filters out another incorrect usage of Cilk_spawn keyword.
> 
> Bootstrapped/regtested on x86_64. Ok for trunk?
> 
> 
> Thanks,
> Igor
>

Comments

Jakub Jelinek April 10, 2014, 2:22 p.m. UTC | #1
On Thu, Apr 10, 2014 at 02:20:42PM +0000, Zamyatin, Igor wrote:
> Resending with correct Changelog. 
> 
> Is it OK?
> 
> Thanks,
> Igor
> 
> gcc/c-family/ChangeLog:
> 
> 2014-04-10  Igor Zamyatin  <igor.zamyatin@intel.com>
> 
>       PR middle-end/60467
>       * cilk.c (cilk_set_spawn_marker): Remove FUNCTION_DECL
>       as possible argument for Cilk_spawn.
> 
> gcc/testsuite/ChangeLog:
> 
> 2014-04-10  Igor Zamyatin  <igor.zamyatin@intel.com>
> 
>       PR middle-end/60467
>       * c-c++-common/cilk-plus/CK/invalid_spawns.c: Add new invalid
>       case to check.

Ok.

	Jakub
diff mbox

Patch

diff --git a/gcc/c-family/cilk.c b/gcc/c-family/cilk.c
index 6a7bf4f..bf549ad 100644
--- a/gcc/c-family/cilk.c
+++ b/gcc/c-family/cilk.c
@@ -99,7 +99,6 @@  cilk_set_spawn_marker (location_t loc, tree fcall)
        it.  */
     return false; 
   else if (TREE_CODE (fcall) != CALL_EXPR
-          && TREE_CODE (fcall) != FUNCTION_DECL
           /* In C++, TARGET_EXPR is generated when we have an overloaded
              '=' operator.  */
           && TREE_CODE (fcall) != TARGET_EXPR)
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_spawns.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_spawns.c
index ba9e619..5b43be7 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_spawns.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_spawns.c
@@ -8,6 +8,7 @@  int main (void)
 {
   int x; 
 
+  _Cilk_spawn foo; /* { dg-error "only function calls can be spawned" } */
   _Cilk_spawn x; /* { dg-error "only function calls can be spawned" } */
   return x;
 }