[RFC] PR27770 (alignment with -fsection-anchors and vectorization) fix

Richard Sandiford richard@codesourcery.com
Wed Aug 2 16:23:00 GMT 2006


Dorit Nuzman <DORIT@il.ibm.com> writes:
> Here's an attempt to address PR27770.

Thanks very much for doing this.

> 1. Don't let the vectorizer increase the alignment of global variables when
> section-anchors is enabled.

I spoke out against this idea earlier in the PR trial, thinking that with
pre-alignment, we should just have an assert instead.  I.e. I thought that
the pre-alignment pass should always increase the alignment of every global
that the vectoriser might want to access.  However, it does sound from your
message, and in particular:

> - The patch increases the alignment of (global) arrays only. We have a few
> testcases though (e.g. vect-69.c) that have global structs that contain
> fields that are arrays. Aligning the beginning of these structs can
> sometime align one/some of their array fields. Since this patch does not
> attempt to do that, we have some tests that will now fail (or fail on
> targets that don't support unaligned accesses). As a first step we can
> avoid the failures by changing the tests to work with local structs instead
> of global structs where possible, and later consider extending the
> optimization to align global structs that have array fields that could
> become aligned as a result.

...that I was being a little naive.  I agree that your approach is better.

I can't comment on the specifics of the patch, but I hope someone does.

Richard



More information about the Gcc-patches mailing list