On Thu, Jun 28, 2012 at 5:23 PM, Ilya Enkovich <enkovich....@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