https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61320

--- Comment #51 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Ah, we also expand one from a TARGET_MEM_REF:
> 
> ;;   basic block 76, loop depth 2
> ;;    pred:       79
>   load_dst_215 = MEM[base: ptr_110, offset: 0B];
> 
> and TARGET_MEM_REF only handles the movmisalign case.  So it's either IVOPTs
> not punting properly here (it does for unaligned accesses - grep for
> STRICT_ALIGNMENT) or we need to put a bitfield extraction case into
> TARGET_MEM_REF expansion (IMHO that's missing anyway, IVOPTs is too much
> pessimized by not considering this).

TARGET_MEM_REF is supposed to be a valid memory access for the target though
and, by definition, an unaligned access is not valid for a strict alignment
target (unless you have a movmisalign pattern), so the problem is the
TARGET_MEM_REF.

If you want to make IVOPTS generate unaligned TARGET_MEM_REFs, you'll need to
make sure that the costs are properly adjusted and benchmark the result.

Reply via email to