> Currently I'm testing the patch below, which simply invalidates the
> load/store. Now I need some help from someone, who is more familiar with
> this code, whether this is the correct approach.

I don't see any other solution than invalidating the MEM.

> Index: gcc/gcse.c
> ===================================================================
> --- gcc/gcse.c        (revision 116085)
> +++ gcc/gcse.c        (working copy)
> @@ -5319,6 +5319,16 @@
>                     else
>                       ptr->invalid = 1;
>                   }
> +               else if (GET_CODE (dest) == ZERO_EXTRACT)
> +                 {
> +                   dest = XEXP (dest, 0);
> +                   if (MEM_P (dest) && simple_mem (dest))
> +                     {
> +                       ptr = ldst_entry (dest);
> +                       ptr->invalid = 1;
> +                     }
> +
> +                 }
>               }
>             else
>               invalidate_any_buried_refs (PATTERN (insn));

Why not simply mimicing the "load" case and calling invalidate_any_buried_refs 
on DEST, with a comment mentioning the (ZERO_EXTRACT (MEM)) corner case?

-- 
Eric Botcazou

Reply via email to