<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Different types share the same TBAA descriptor"
   href="https://bugs.llvm.org/show_bug.cgi?id=35703">35703</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Different types share the same TBAA descriptor
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sepavloff@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Run commands:

$ cat bug-02.c 
typedef struct {
   short f16;
   int f32;
} ABC;
typedef struct {
   short v16;
   int v32;
} CDE;

void func(ABC *A, CDE *B) {
  A->f32 = 4;
  B->v32 = 44;
}

$ clang -S -emit-llvm -O1 bug-02.c

The resulting .ll file contains:

%struct.ABC = type { i16, i32 }
%struct.CDE = type { i16, i32 }

; Function Attrs: norecurse nounwind uwtable
define void @func(%struct.ABC* nocapture %A, %struct.CDE* nocapture %B)
local_unnamed_addr #0 {
entry:
  %f32 = getelementptr inbounds %struct.ABC, %struct.ABC* %A, i64 0, i32 1
  store i32 4, i32* %f32, align 4, !tbaa !2
  %v32 = getelementptr inbounds %struct.CDE, %struct.CDE* %B, i64 0, i32 1
  store i32 44, i32* %v32, align 4, !tbaa !2
  ret void
}
...
!2 = !{!3, !7, i64 4}
!3 = !{!"", !4, i64 0, !7, i64 4}
!4 = !{!"short", !5, i64 0}
!5 = !{!"omnipotent char", !6, i64 0}
!6 = !{!"Simple C/C++ TBAA"}
!7 = !{!"int", !5, i64 0}

Two different types use the same descriptor (!3). In C++ mode there is no such
problem, types get their names from typedef names.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>