[llvm-bugs] [Bug 30350] New: "More than one parameter has attribute returned!" after gvn/functionattrs interaction.

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 11 23:47:58 PDT 2016


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

            Bug ID: 30350
           Summary: "More than one parameter has attribute returned!"
                    after gvn/functionattrs interaction.
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17243
  --> https://llvm.org/bugs/attachment.cgi?id=17243&action=edit
Small reproducer

Can be reproduced with

opt -S -functionattrs -gvn -functionattrs red.ll

The input code looks like:

define i32 @f1(i32 %p1, i32 %p2) local_unnamed_addr {
  %_tmp4 = icmp eq i32 %p1, %p2
  br i1 %_tmp4, label %bb2, label %bb1

bb2:                                              ; preds = %0
  ret i32 %p2

bb1:                                              ; preds = %0, %bb1
  br label %bb1
}


The first functionattrs pass adds the "returned" attribute to %p2. Then gvn
comes and change the

ret i32 %p2


to

ret i32 %p1


but still leaves "returned" on %p2, and finally when functionattrs runs again
it now adds
"returned" to "%p1" (while it's still on %p2), leaving "returned" on both %p1
and %p2, and
then the verifier pukes on it.

-- 
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/20160912/a6581ff9/attachment.html>


More information about the llvm-bugs mailing list