This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: The problem with force_gimple_operand and &TARGET_MEM_REF
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 29 Jun 2012 10:37:45 +0200
- Subject: Re: The problem with force_gimple_operand and &TARGET_MEM_REF
- References: <CAMbmDYa1WM0wnZp3vFNDuK9OJ8NrHDg7ndy4-jwQ-DPmw3sF+Q@mail.gmail.com>
On Thu, Jun 28, 2012 at 5:23 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
> Hello,
>
> I faced a problem with usage of force_gimple_operand function for
> specific tree. I have a TARGET_MEM_REF tree node whose address I want
> to pass as argument to the function call. I use build_fold_addr_expr
> to get address tree and then pass it to force_gimple_operand which
> generates strange sequence of statements.
>
> Original mem ref: MEM[base: arr_5, index: ivtmp.130_22, step: 8, offset: 0B]
>
> build_fold_addr_expr result: &MEM[base: dirlist_5, index:
> ivtmp.130_22, step: 8, offset: 0B]
>
> force_gimple_operand result:
> D.5638_65 = MEM[base: dirlist_5, index: ivtmp.130_22, step: 8, offset: 0B];
> D.5639_66 = D.5638_65;
> D.5640_67 = D.5639_66;
> D.5642_68 = D.5640_67;
> D.5641_69 = &D.5642_68;
>
> Code produced by force_gimple_operand is incorrect, has changed
> semantics compared to original tree and fails later at gimple
> verification.
>
> Do I use wrong interfaces?
You cannot take the address of a TARGET_MEM_REF.
Richard.
> Thanks
> Ilya