This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ipa/65270] [5 regression] ICF needs to match TYPE attributes on memory accesses
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 Mar 2015 09:45:30 +0000
- Subject: [Bug ipa/65270] [5 regression] ICF needs to match TYPE attributes on memory accesses
- Auto-submitted: auto-generated
- References: <bug-65270-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65270
--- Comment #12 from rguenther at suse dot de <rguenther at suse dot de> ---
On Tue, 3 Mar 2015, hubicka at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65270
>
> --- Comment #10 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
> Hi,
> while looking for a testcase that would trigger with tree-tail-merge (because
> gimple-fold seems to also miss MEM_REF merging) I noticed following oddity:
>
> struct a
> {
> int a[100000];
> };
> typedef struct a b __attribute__ ((aligned (32)));
> typedef struct a c __attribute__ ((aligned (8)));
> typedef struct a d __attribute__ ((aligned (32)));
>
> __attribute__ ((used))
> t(b *a, int aligned, b *d)
> {
> int i,v;
> c *ptr = a;
> for (i=0;i<100000;i++)
> {
> ptr->a[i]++;
> }
> }
> main()
> {
> }
>
> here the loop gets vectorized with assumed alignmen 32.
> Changing declaretion to:
> t(c *a, int aligned, b *d)
> produces correct 8 byte alignment loop.
> Alignment of the type of variable A shall not be used.
Hmm. And it's correctly handled by get_object_alignment. It's
the vectorizer code that does odd things here. I'll fix it.