Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-28 Thread Jason Merrill
On 06/28/2013 12:54 AM, Iyer, Balaji V wrote: I agree with you and I have fixed it such that if TREE_TYPE is void then don't bother creating a new variable. This error happens in comma_exp.c testcase in Mac. For example, the following expression: array[:] = (atoi(argv[1]),

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-28 Thread Jason Merrill
On 06/28/2013 12:54 AM, Iyer, Balaji V wrote: /* If stride and start are of same type and the induction var is not, convert induction variable to stride's type. */ if (TREE_TYPE (start) == TREE_TYPE (stride) TREE_TYPE (stride) != TREE_TYPE

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-28 Thread Jason Merrill
OK. Jason

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-27 Thread Jason Merrill
On 06/27/2013 02:36 PM, Iyer, Balaji V wrote: I looked through the patch again. I was able to get rid of the first if-statement in cp_parser_postfix_open_square_expression function. I think now it looks exactly as you requested. Much better, thanks. + /* Sometimes, it

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-26 Thread Aldy Hernandez
On 06/25/13 13:42, Iyer, Balaji V wrote: What remaining obstacles are there to sharing most of the expansion code between C and C++? That can be a separate patch, of course. Jason ??

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-26 Thread Jason Merrill
On 06/26/2013 01:31 PM, Iyer, Balaji V wrote: Attached, please find a fixed patch and ChangeLog entries: This patch seems to be missing some hunks that are described in the ChangeLog and were present in the previous patch, such as * cp-array-notation.c

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-25 Thread Jason Merrill
On 06/24/2013 06:23 PM, Iyer, Balaji V wrote: Actually, to reduce the amount of changes to non-AN code, let's put the AN case third, after the offset and {} cases, so you get something like else if (flag_enable_cilkplus) { tree an = cp_parser_array_notation (loc, parser, index,

RE: [PATCH] Cilk Plus Array Notation for C++

2013-06-25 Thread Iyer, Balaji V
-Original Message- From: Jason Merrill [mailto:ja...@redhat.com] Sent: Tuesday, June 25, 2013 10:39 AM To: Iyer, Balaji V; Richard Henderson Cc: Aldy Hernandez; gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Cilk Plus Array Notation for C++ On 06/24/2013 06:23 PM, Iyer, Balaji V

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-25 Thread Jason Merrill
On 06/25/2013 02:27 PM, Iyer, Balaji V wrote: This time, I ran the command you gave me. Please tell me how it looks. No ChangeLog this time, thanks. Another solution is to replace get_tmp_regvar with get_temporary_var () + add_decl_expr (..). I have implemented this because it looks more

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-24 Thread Jason Merrill
A few more comments: + if (processing_template_decl || !TREE_TYPE (t)) + new_var = build_min_nt_loc (EXPR_LOCATION (t), VAR_DECL, NULL_TREE, + NULL_TREE); Again, we shouldn't be trying to expand array notation during template parsing.

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-22 Thread Jason Merrill
Hmm, seems like I should have sent this yesterday even though I hadn't made it through the whole patch. But I suppose it doesn't hurt to fix it after checkin. On 06/20/2013 07:39 PM, Iyer, Balaji V wrote: diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog old mode 100644 new mode

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-21 Thread Richard Henderson
On 06/20/2013 04:39 PM, Iyer, Balaji V wrote: I couldn't put them into 1 structure, so I made 2 structures holding the following information: array notation triplet information and array notation expansion loop's information. It is fixed in the patch attached. Excellent, thanks. One thing

RE: [PATCH] Cilk Plus Array Notation for C++

2013-06-21 Thread Iyer, Balaji V
-Original Message- From: Richard Henderson [mailto:r...@redhat.com] Sent: Friday, June 21, 2013 12:11 PM To: Iyer, Balaji V Cc: Aldy Hernandez; gcc-patches@gcc.gnu.org; Jason Merrill (ja...@redhat.com) Subject: Re: [PATCH] Cilk Plus Array Notation for C++ On 06/20/2013 04:39 PM

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-21 Thread Richard Henderson
On 06/21/2013 09:59 AM, Iyer, Balaji V wrote: After I remove that field, will it be OK for trunk? Yes. r~

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-20 Thread Richard Henderson
+/* Returns true if there is a length mismatch among exprssions that are at the + same dimension and one the same side of the equal sign. The Array notation + lengths (LIST) is passed in as a 2D vector of trees. */ + +static bool +cp_length_mismatch_in_expr_p (location_t loc,

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-18 Thread Aldy Hernandez
Thanks for fixing everything. This looks much better. I don't have much, just small typos. It's up to Jason and Richard to take it from here. Aldy + else + { + val = convert_like_with_context (conv, arg, fn, i-is_method, +

RE: [PATCH] Cilk Plus Array Notation for C++

2013-06-17 Thread Iyer, Balaji V
] Cilk Plus Array Notation for C++ On 06/13/2013 09:11 AM, Aldy Hernandez wrote: The whole slew of these cases have a lot of duplicated code. For instance, BUILT_IN_CILKPLUS_SEC_REDUCE_MIN is the same as BUILT_IN_CILKPLUS_SEC_REDUCE_MAX, the only difference being GT_EXPR vs LT_EXPR

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-17 Thread Richard Henderson
On 06/17/2013 10:00 AM, Iyer, Balaji V wrote: In hindsight, I could have for __sec_reduce_max and __sec_reduce_min. I was more familiar with conditional expression. Out of curiosity, is there a big performance benefit of using max/min expr over conditional? There can be. The COND-MIN/MAX

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-13 Thread Aldy Hernandez
It looks like a NULL in INIT_INDEX is a specially handled case. Perhaps you should document that INIT_INDEX can be null and what it means. Also, you don't need to document what internal variable name you are using as a return value (VALUE_TREE). Perhaps instead of The return value... you

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-13 Thread Richard Henderson
On 06/13/2013 09:11 AM, Aldy Hernandez wrote: The whole slew of these cases have a lot of duplicated code. For instance, BUILT_IN_CILKPLUS_SEC_REDUCE_MIN is the same as BUILT_IN_CILKPLUS_SEC_REDUCE_MAX, the only difference being GT_EXPR vs LT_EXPR. Surely you could do something like: if

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-12 Thread Aldy Hernandez
[Jason/Richard: there are some things below I could use your feedback on.] Hi Balaji. Overall, a lot of the stuff in cp-array-notation.c looks familiar from the C front-end changes. Can't you reuse a lot of it? Otherwise, here are some minor nits... + /* If the function call is

RE: [PATCH] Cilk Plus Array Notation for C++

2013-06-12 Thread Iyer, Balaji V
...@redhat.com); r...@redhat.com Subject: Re: [PATCH] Cilk Plus Array Notation for C++ [Jason/Richard: there are some things below I could use your feedback on.] Hi Balaji. Overall, a lot of the stuff in cp-array-notation.c looks familiar from the C front- end changes. Can't you reuse

Re: [PATCH] Cilk Plus Array Notation for C++

2013-06-12 Thread Aldy Hernandez
Overall, a lot of the stuff in cp-array-notation.c looks familiar from the C front- end changes. Can't you reuse a lot of it? I looked into trying to combine many functionality. The issue that prohibited me was templates and extra trees. For example, IF_STMT, FOR_STMT, MODOP_EXPR, etc are

RE: [PATCH] Cilk Plus Array Notation for C++

2013-06-12 Thread Iyer, Balaji V
-Original Message- From: Aldy Hernandez [mailto:al...@redhat.com] Sent: Wednesday, June 12, 2013 1:40 PM To: Iyer, Balaji V Cc: gcc-patches@gcc.gnu.org; Jason Merrill (ja...@redhat.com); r...@redhat.com Subject: Re: [PATCH] Cilk Plus Array Notation for C++ Overall, a lot