This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/3] Fix logic bug in Cilk Plus array expansion
- From: Jeff Law <law at redhat dot com>
- To: Patrick Palka <patrick at parcs dot ath dot cx>, gcc-patches at gcc dot gnu dot org
- Cc: jakub at redhat dot com, jason at redhat dot com
- Date: Fri, 1 Jan 2016 22:06:34 -0700
- Subject: Re: [PATCH 1/3] Fix logic bug in Cilk Plus array expansion
- Authentication-results: sourceware.org; auth=none
- References: <1451576417-8710-1-git-send-email-patrick at parcs dot ath dot cx>
On 12/31/2015 08:40 AM, Patrick Palka wrote:
The Cilk Plus code may sometimes turn a COND_EXPR into an
error_mark_node for no good reason. This can be seen by compiling the
test case c-c++-common/cilk-plus/CK/pr60469.c with both gcc and g++ and
observing the differences of the -fdump-tree-original dumps:
With gcc, we get the following code in the GENERIC dump:
finally
{
_Cilk_sync;
D.1897.worker->current_stack_frame = D.1897.call_parent;
__cilkrts_pop_frame (&D.1897);
if (D.1897.flags != 16777216)
{
__cilkrts_leave_frame (&D.1897);
}
}
Whereas with g++ we get
finally
{
_Cilk_sync;
D.2387.worker->current_stack_frame = D.2387.call_parent;
__cilkrts_pop_frame (&D.2387);
<<< error >>>
}
Notice that the COND_EXPR is replaced with an << error >> in the g++
dump.
This patch fixes the COND_EXPR handling within Cilk Plus. I think the
cause is a simple typo/logic bug.
gcc/cp/ChangeLog:
* cp-array-notation.c (cp_expand_cond_array_notations): Return
error_mark_node only if find_rank failed, not if it was
successful.
Can you use -fdump-tree-original in the testcase and verify there's no
<<< error >>> expressions in the resulting dump file?
With that change, this is OK.
jeff