This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Avoid bugs like PR68273 to trigger
- From: Richard Biener <rguenther at suse dot de>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 8 Feb 2016 11:25:44 +0100 (CET)
- Subject: Re: [PATCH] Avoid bugs like PR68273 to trigger
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1602081100180 dot 31122 at t29 dot fhfr dot qr> <41571746 dot 1n7pokyEgI at polaris>
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.