[llvm-bugs] [Bug 44881] New: [DebugInfo at O2] DAGCombine drops easily salvageable variable location

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 12 03:48:06 PST 2020


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

            Bug ID: 44881
           Summary: [DebugInfo at O2] DAGCombine drops easily salvageable
                    variable location
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Keywords: wrong-debug
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: jeremy.morse.llvm at gmail.com
                CC: chackz0x12 at gmail.com, greg.bedwell at sony.com,
                    llvm-bugs at lists.llvm.org, orlando.hyams at sony.com,
                    paul.robinson at am.sony.com, stephen.tozer at sony.com,
                    vsk at apple.com
            Blocks: 38768

Spun off from bug 39724, Davides test case which I copy below has 'l' optimised
out in the fn1 function. The cause appears to be a DAGCombine that drops the
multiply, which the SelectionDAG salvager can't recover. This is true of todays
master, 2733ad2c24 ish.

--------8<--------
a.c:

extern void other_func(long int, long int, long int);

__attribute__((noinline))
        int fn1 (long int x, long int y, long int z) {
                        int l = x * 2;
                                int q = y * z;
                                other_func(x, y, z);
                                        return l + q;
        }

__attribute__((noinline)) long int
fn2 (long int a, long int b, long int c)
{
          long int q = 2 * a;
            return fn1 (5, 6, 7);
}

int main(void) {
                return fn2(14, 23, 34);
}

b.c:

void other_func(long int a, long int b, long int c) {}


built with: ${CC} a.c b.c -O3 -g
-------->8--------

I guess this ticket can more broadly represents the fact that all the folding /
morphing in DAGCombine isn't robustly salvaged.


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=38768
[Bug 38768] [meta][DebugInfo] Umbrella bug for poor debug experiences
-- 
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/20200212/d2e33892/attachment-0001.html>


More information about the llvm-bugs mailing list