[LLVMbugs] [Bug 3835] New: miscompilation of constant function returning a struct

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Mar 18 11:21:45 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=3835

           Summary: miscompilation of constant function returning a struct
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: castet.matthieu at free.fr
                CC: llvmbugs at cs.uiuc.edu


clang translate the C function "AVExtFloat av_dbl2ext(double d)
__attribute__((const));" to "void @av_dbl2ext(%struct.AVExtFloat* noalias sret,
double) readnone".

But the handling of the const argument is wrong : the struct is pass as
argument for output. So the function is no more const.

Compiling the attached test case at -O3 remove the call to av_dbl2ext because
of that.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list