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

            Bug ID: 65270
           Summary: [5 regression] ICF needs to match TYPE attributes on
                    memory accesses
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org

As discussed here https://gcc.gnu.org/ml/gcc-patches/2015-03/msg00028.html

$ more t.c
struct a 
{
  int a[100000];
}
__attribute__ ((aligned (32)));
struct b 
{
  int a[100000];
};
t2(struct a *a)
{
  int i;
  for (i=0;i<100000;i++)
    a->a[i]++;
}
t(struct b *a)
{
  int i;
  for (i=0;i<100000;i++)
    a->a[i]++;
}
$ ./xgcc -B ./ -O3 t.c -flto -c  -fno-inline 
t.c:10:1: warning: return type defaults to �int� [-Wimplicit-int]
 t2(struct a *a)
 ^
t.c:16:1: warning: return type defaults to �int� [-Wimplicit-int]
 t(struct b *a)
 ^
$ ./xgcc -B ./ -O3 t.o -flto  -r -nostdlib
$ objdump a.out -d

a.out:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <t2>:
   0:   48 8d 87 80 1a 06 00    lea    0x61a80(%rdi),%rax
   7:   66 0f 6f 0d 00 00 00    movdqa 0x0(%rip),%xmm1        # f <t2+0xf>
   e:   00 
   f:   90                      nop
  10:   48 83 c7 10             add    $0x10,%rdi
  14:   66 0f 6f 47 f0          movdqa -0x10(%rdi),%xmm0
  19:   66 0f fe c1             paddd  %xmm1,%xmm0
  1d:   0f 29 47 f0             movaps %xmm0,-0x10(%rdi)
  21:   48 39 c7                cmp    %rax,%rdi
  24:   75 ea                   jne    10 <t2+0x10>
  26:   f3 c3                   repz retq 
  28:   0f 1f 84 00 00 00 00    nopl   0x0(%rax,%rax,1)
  2f:   00 

0000000000000030 <t>:
  30:   e9 00 00 00 00          jmpq   35 <t+0x5>

The functions t and t2 are incorrectly unified.

Reply via email to