public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] fix gimplification of call parameters (PR cilkplus/69267)
@ 2016-01-15 22:41 Ryan Burn
  2016-01-19 14:28 ` Ryan Burn
  2016-01-27 17:19 ` Jeff Law
  0 siblings, 2 replies; 4+ messages in thread
From: Ryan Burn @ 2016-01-15 22:41 UTC (permalink / raw)
  To: gcc-patches, law, jason; +Cc: igor.zamyatin

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

This patch changes the function cilk_gimplify_call_params_in_spawned_fn to use gimplify_arg instead of gimplify_expr. It fixes an ICE when calling a function with a constructed empty class as the argument.

Bootstrapped and regression tested on x86_64-linux.

2016-01-15  Ryan Burn  <contact@rnburn.com>

        PR cilkplus/69267
        * cilk.c (cilk_gimplify_call_params_in_spawned_fn): Change to use
        gimplify_arg. Removed superfluous post_p argument.
        * c-family.h (cilk_gimplify_call_params_in_spawned_fn): Removed
        superfluous post_p argument.
        * c-gimplify.c (c_gimplify_expr): Likewise.

gcc/cp/ChangeLog:

2016-01-15  Ryan Burn  <contact@rnburn.com>

        PR cilkplus/69267
        * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
        superfluous post_p argument in call to
        cilk_gimplify_call_params_in_spawned_fn.

gcc/testsuite/ChangeLog:

2016-01-15  Ryan Burn  <contact@rnburn.com>      
                                                                                          
PR cilkplus/69267
* g++.dg/cilk-plus/CK/pr69267.cc: New test.




[-- Attachment #2: pr69267.diff --]
[-- Type: application/octet-stream, Size: 3215 bytes --]

Index: gcc/c-family/cilk.c
===================================================================
--- gcc/c-family/cilk.c	(revision 232359)
+++ gcc/c-family/cilk.c	(working copy)
@@ -774,8 +774,7 @@
    gimple sequences from the caller of gimplify_cilk_spawn.  */
 
 void
-cilk_gimplify_call_params_in_spawned_fn (tree *expr_p, gimple_seq *pre_p,
-					 gimple_seq *post_p)
+cilk_gimplify_call_params_in_spawned_fn (tree *expr_p, gimple_seq *pre_p)
 {
   int ii = 0;
   tree *fix_parm_expr = expr_p;
@@ -792,8 +791,8 @@
 
   if (TREE_CODE (*fix_parm_expr) == CALL_EXPR)
     for (ii = 0; ii < call_expr_nargs (*fix_parm_expr); ii++)
-      gimplify_expr (&CALL_EXPR_ARG (*fix_parm_expr, ii), pre_p, post_p,
-		     is_gimple_reg, fb_rvalue);
+      gimplify_arg (&CALL_EXPR_ARG (*fix_parm_expr, ii), pre_p,
+		    EXPR_LOCATION (*fix_parm_expr));
 }
 
 
Index: gcc/c-family/c-common.h
===================================================================
--- gcc/c-family/c-common.h	(revision 232359)
+++ gcc/c-family/c-common.h	(working copy)
@@ -1449,8 +1449,7 @@
 extern tree insert_cilk_frame (tree);
 extern void cilk_init_builtins (void);
 extern int gimplify_cilk_spawn (tree *);
-extern void cilk_gimplify_call_params_in_spawned_fn (tree *, gimple_seq *,
-						     gimple_seq *);
+extern void cilk_gimplify_call_params_in_spawned_fn (tree *, gimple_seq *);
 extern void cilk_install_body_with_frame_cleanup (tree, tree, void *);
 extern bool cilk_detect_spawn_and_unwrap (tree *);
 extern bool cilk_set_spawn_marker (location_t, tree);
Index: gcc/c-family/c-gimplify.c
===================================================================
--- gcc/c-family/c-gimplify.c	(revision 232359)
+++ gcc/c-family/c-gimplify.c	(working copy)
@@ -277,7 +277,7 @@
 
       if (!seen_error ())
 	{
-	  cilk_gimplify_call_params_in_spawned_fn (expr_p, pre_p, post_p);
+	  cilk_gimplify_call_params_in_spawned_fn (expr_p, pre_p);
 	  return (enum gimplify_status) gimplify_cilk_spawn (expr_p);
 	}
       return GS_ERROR;
@@ -292,7 +292,7 @@
 	     it is supposed to be.  */
 	  && !seen_error ())
 	{
-	  cilk_gimplify_call_params_in_spawned_fn (expr_p, pre_p, post_p);
+	  cilk_gimplify_call_params_in_spawned_fn (expr_p, pre_p);
 	  return (enum gimplify_status) gimplify_cilk_spawn (expr_p);
 	}
 
Index: gcc/cp/cp-gimplify.c
===================================================================
--- gcc/cp/cp-gimplify.c	(revision 232359)
+++ gcc/cp/cp-gimplify.c	(working copy)
@@ -98,7 +98,7 @@
 {
   int ii = 0;
 
-  cilk_gimplify_call_params_in_spawned_fn (expr_p, pre_p, post_p);  
+  cilk_gimplify_call_params_in_spawned_fn (expr_p, pre_p);
   if (TREE_CODE (*expr_p) == AGGR_INIT_EXPR)
     for (ii = 0; ii < aggr_init_expr_nargs (*expr_p); ii++)
       gimplify_expr (&AGGR_INIT_EXPR_ARG (*expr_p, ii), pre_p, post_p,
Index: gcc/testsuite/g++.dg/cilk-plus/CK/pr69267.cc
===================================================================
--- gcc/testsuite/g++.dg/cilk-plus/CK/pr69267.cc	(revision 0)
+++ gcc/testsuite/g++.dg/cilk-plus/CK/pr69267.cc	(working copy)
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+struct A {};
+
+void f (A) {}
+
+void g () {
+  _Cilk_spawn f (A ());
+}

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

* Re: [PATCH] fix gimplification of call parameters (PR cilkplus/69267)
  2016-01-15 22:41 [PATCH] fix gimplification of call parameters (PR cilkplus/69267) Ryan Burn
@ 2016-01-19 14:28 ` Ryan Burn
  2016-01-25 15:15   ` Ryan Burn
  2016-01-27 17:19 ` Jeff Law
  1 sibling, 1 reply; 4+ messages in thread
From: Ryan Burn @ 2016-01-19 14:28 UTC (permalink / raw)
  To: gcc-patches, law, jason

Does this look ok?

> On Jan 15, 2016, at 5:41 PM, Ryan Burn <rnickb731@gmail.com> wrote:
> 
> This patch changes the function cilk_gimplify_call_params_in_spawned_fn to use gimplify_arg instead of gimplify_expr. It fixes an ICE when calling a function with a constructed empty class as the argument.
> 
> Bootstrapped and regression tested on x86_64-linux.
> 
> 2016-01-15  Ryan Burn  <contact@rnburn.com>
> 
>        PR cilkplus/69267
>        * cilk.c (cilk_gimplify_call_params_in_spawned_fn): Change to use
>        gimplify_arg. Removed superfluous post_p argument.
>        * c-family.h (cilk_gimplify_call_params_in_spawned_fn): Removed
>        superfluous post_p argument.
>        * c-gimplify.c (c_gimplify_expr): Likewise.
> 
> gcc/cp/ChangeLog:
> 
> 2016-01-15  Ryan Burn  <contact@rnburn.com>
> 
>        PR cilkplus/69267
>        * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
>        superfluous post_p argument in call to
>        cilk_gimplify_call_params_in_spawned_fn.
> 
> gcc/testsuite/ChangeLog:
> 
> 2016-01-15  Ryan Burn  <contact@rnburn.com>      
> 
> PR cilkplus/69267
> * g++.dg/cilk-plus/CK/pr69267.cc: New test.
> 
> 
> 
> <pr69267.diff>

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

* Re: [PATCH] fix gimplification of call parameters (PR cilkplus/69267)
  2016-01-19 14:28 ` Ryan Burn
@ 2016-01-25 15:15   ` Ryan Burn
  0 siblings, 0 replies; 4+ messages in thread
From: Ryan Burn @ 2016-01-25 15:15 UTC (permalink / raw)
  To: Ryan Burn; +Cc: gcc-patches, Jeff Law, Jason Merrill

ping

On Tue, Jan 19, 2016 at 9:28 AM, Ryan Burn <ryan.burn@gmail.com> wrote:
> Does this look ok?
>
>> On Jan 15, 2016, at 5:41 PM, Ryan Burn <rnickb731@gmail.com> wrote:
>>
>> This patch changes the function cilk_gimplify_call_params_in_spawned_fn to use gimplify_arg instead of gimplify_expr. It fixes an ICE when calling a function with a constructed empty class as the argument.
>>
>> Bootstrapped and regression tested on x86_64-linux.
>>
>> 2016-01-15  Ryan Burn  <contact@rnburn.com>
>>
>>        PR cilkplus/69267
>>        * cilk.c (cilk_gimplify_call_params_in_spawned_fn): Change to use
>>        gimplify_arg. Removed superfluous post_p argument.
>>        * c-family.h (cilk_gimplify_call_params_in_spawned_fn): Removed
>>        superfluous post_p argument.
>>        * c-gimplify.c (c_gimplify_expr): Likewise.
>>
>> gcc/cp/ChangeLog:
>>
>> 2016-01-15  Ryan Burn  <contact@rnburn.com>
>>
>>        PR cilkplus/69267
>>        * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
>>        superfluous post_p argument in call to
>>        cilk_gimplify_call_params_in_spawned_fn.
>>
>> gcc/testsuite/ChangeLog:
>>
>> 2016-01-15  Ryan Burn  <contact@rnburn.com>
>>
>> PR cilkplus/69267
>> * g++.dg/cilk-plus/CK/pr69267.cc: New test.
>>
>>
>>
>> <pr69267.diff>
>

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

* Re: [PATCH] fix gimplification of call parameters (PR cilkplus/69267)
  2016-01-15 22:41 [PATCH] fix gimplification of call parameters (PR cilkplus/69267) Ryan Burn
  2016-01-19 14:28 ` Ryan Burn
@ 2016-01-27 17:19 ` Jeff Law
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Law @ 2016-01-27 17:19 UTC (permalink / raw)
  To: Ryan Burn, gcc-patches, jason; +Cc: igor.zamyatin

On 01/15/2016 03:41 PM, Ryan Burn wrote:
> 2016-01-15  Ryan Burn<contact@rnburn.com>
>
>          PR cilkplus/69267
>          * cilk.c (cilk_gimplify_call_params_in_spawned_fn): Change to use
>          gimplify_arg. Removed superfluous post_p argument.
>          * c-family.h (cilk_gimplify_call_params_in_spawned_fn): Removed
>          superfluous post_p argument.
>          * c-gimplify.c (c_gimplify_expr): Likewise.
>
> gcc/cp/ChangeLog:
>
> 2016-01-15  Ryan Burn<contact@rnburn.com>
>
>          PR cilkplus/69267
>          * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
>          superfluous post_p argument in call to
>          cilk_gimplify_call_params_in_spawned_fn.
>
> gcc/testsuite/ChangeLog:
>
> 2016-01-15  Ryan Burn<contact@rnburn.com>
>
> PR cilkplus/69267
> * g++.dg/cilk-plus/CK/pr69267.cc: New test.
>
Thanks.  Even though we're in stage4, this came in before stage3 closed. 
  I went ahead and committed it to the trunk.

Thanks again, and sorry about the delay.

jeff

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

end of thread, other threads:[~2016-01-27 17:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-15 22:41 [PATCH] fix gimplification of call parameters (PR cilkplus/69267) Ryan Burn
2016-01-19 14:28 ` Ryan Burn
2016-01-25 15:15   ` Ryan Burn
2016-01-27 17:19 ` Jeff Law

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).