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, PR66432] Handle PARM_DECL in remap_gimple_op_r


On Wed, Jul 1, 2015 at 7:09 PM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> On 01/07/15 13:58, Richard Biener wrote:
>>
>> On Wed, Jul 1, 2015 at 1:43 PM, Tom de Vries <Tom_deVries@mentor.com>
>> wrote:
>>>
>>> Hi,
>>>
>>> I.
>>>
>>> When running test libgomp.c/appendix-a/a.29.1.c with '--target_board
>>> unix/-O2/-g', we run into this failure:
>>> ...
>>> FAIL: libgomp.c/appendix-a/a.29.1.c (test for excess errors)
>>> Excess errors:
>>> src/libgomp/testsuite/libgomp.c/appendix-a/a.29.1.c:6:1: error: type
>>> mismatch between an SSA_NAME and its symbol
>>> ...
>>>
>>> Without -g, the testcase passes.
>>>
>>>
>>> II.
>>>
>>> The scenario for the failure is as follows:
>>>
>>> At fnsplit, we split off f.part.0 from f, which at source level looks
>>> like
>>> this:
>>> ...
>>> void
>>> f (int n, int B[n][n], int C[])
>>> {
>>>    int D[2][2] = { 1, 2, 3, 4 };
>>>    int E[n][n];
>>>    assert (n >= 2);
>>>    E[1][1] = 4;
>>> #pragma omp parallel firstprivate(B, C, D, E)
>>>    {
>>>      assert (sizeof (B) == sizeof (int (*)[n]));
>>>      assert (sizeof (C) == sizeof (int *));
>>>      assert (sizeof (D) == 4 * sizeof (int));
>>>      assert (sizeof (E) == n * n * sizeof (int));
>>>      /* Private B and C have values of original B and C. */
>>>      assert (&B[1][1] == &A[1][1]);
>>>      assert (&C[3] == &A[1][1]);
>>>      assert (D[1][1] == 4);
>>>      assert (E[1][1] == 4);
>>>    }
>>> }
>>> ...
>>>
>>> The split introduces a debug_insn and ssa-name that references param B in
>>> f:
>>> ...
>>>    # DEBUG D#4ptD.0 => B_3(D)
>>> ..
>>>
>>> And a debug_insn that references param B in f.part.0:
>>> ...
>>>    # DEBUG D#7ptD.0 s=> BD.1846
>>> ...
>>>
>>> At this point, the type of the ssa name and the param are the same.
>>
>>
>> With the same PARM_DECL?  I think that's the bug.
>>
>
> Attached patch also fixes the ICE, by copying the PARM_DECL using in the
> debug insn. Does this look ok for testing?

Hmm, it looks like it would break the purpose of this strange code.
It looks like
Jakub added this so CCing him for comments.

What should probably be done is to indeed copy the PARM_DECL for the reference
in the callee but make it have an abstract origin refering to the
PARM_DECL in the
caller?

Jakub did add guality tests - gcc.dg/guality/pr54519-?.c so you might want to
check whether that still passes after any change (and first check it still tests
what it is supposed to test, that is, ipa-split still applying and
removing a parameter)

Richard.

> Thanks,
> - Tom


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