[llvm-bugs] [Bug 35266] New: clang crashes in 'Codegen Prepare' with '-c -O2'

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 9 12:23:31 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35266

            Bug ID: 35266
           Summary: clang crashes in 'Codegen Prepare' with '-c -O2'
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sunil_srivastava at playstation.sony.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19394
  --> https://bugs.llvm.org/attachment.cgi?id=19394&action=edit
C++ Source

clang, crashes in 'Codegen Prepare' with '-c -O2'. The reproduction here is on
x86_64-unknown-gnu r314794, but was originally found with x86_64-scei-ps4. 

The crash started since r314794, but exists in current trunk as well.

Attaching dump info. Source is:

int bar(int v);
struct T {
  unsigned char f;
};
struct U {
  unsigned long q;
  struct T *d;
};
struct H {
  struct U *p;
};
struct S {
  union {
    unsigned long fc;
    struct {
      int i;
      int j;
    } a;
    struct {
      int i;
      int j;
    } b;
  } u;
};
void foo(struct H *h, struct S *s) {
  struct U *u;
  u = h->p;
  int m = 0;
  if (u->d) {
    if (s)
      m = s->u.a.j;
  }
  m = bar(m);
  if (u->d) {
    s->u.a.j = m;
    s->u.a.i = 0x01;
  } else {
    s->u.b.j = m;
    s->u.b.i = 0x01;
  }
  u->d->f = 0x10;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171109/c9166732/attachment.html>


More information about the llvm-bugs mailing list