[llvm-bugs] [Bug 32259] New: InstCombiner::PromoteCastOfAllocation performs irrelevant check of type alignment

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 13 14:36:35 PDT 2017


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

            Bug ID: 32259
           Summary: InstCombiner::PromoteCastOfAllocation performs
                    irrelevant check of type alignment
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: llvm-bugs at lists.llvm.org

Instcombine fails to fold the bitcast into the alloca for 'n' in this case:

  void f() { int n; char *volatile p = (char*)&n; }

... because it (incorrectly, as far as I can tell) thinks the ABI alignment of
the source and destination types is in some way relevant to the transformation.
Instead, it should ignore type alignment entirely and instead simply preserve
the alignment of the incoming alloca (setting it to the alignment of the
original type in the process, if it was previously omitted).

-- 
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/20170313/ba99d2b9/attachment.html>


More information about the llvm-bugs mailing list