This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/3] Fix logic bug in Cilk Plus array expansion


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]