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] Avoid bugs like PR68273 to trigger


On Mon, 8 Feb 2016, Eric Botcazou wrote:

> > This makes it less likely (for example through the PRE path) to trigger
> > target bugs like PR68273 where targets use type alignment of call
> > arguments to decide on the ABI.
> > 
> > Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
> 
> Thanks.  I think that we can also avoid this issue by teaching SRA not to 
> over-align scalar types, I don't see any point in doing that.  It's done in:
> 
>   misalign = (misalign + offset) & (align - 1);
>   if (misalign != 0)
>     align = (misalign & -misalign);
>   if (align != TYPE_ALIGN (exp_type))
>     exp_type = build_aligned_type (exp_type, align);
> 
>   mem_ref = fold_build2_loc (loc, MEM_REF, exp_type, base, off);

No, that's not over-aliging a salar type, that's preserving alignment
information on the memory reference.  What would need to be fixed
here is to see where that 'mem_ref' is assigned to a SSA name and
avoid making that SSA name have an over-aligned type.

Richard.


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