[LLVMbugs] [Bug 9556] New: clang does not support gcc builtin llabs

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 25 13:59:23 PDT 2011


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

           Summary: clang does not support gcc builtin llabs
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ahatanak at gmail.com
                CC: llvmbugs at cs.uiuc.edu


In the following example, builtin function llabs is superseded by the function
defined in the same file.   

# 20021127-1.c
long long a = -1;
long long llabs (long long);
void abort (void);
int
main()
{
  if (llabs (a) != 1)
    abort ();
  return 0;
}
long long llabs (long long b)
{
  abort ();
}

# generated .ll code 
# clang 20021127-1.c -o 20021127-1.ll  -S -emit-llvm -O3
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i386-pc-linux-gnu"

@a = global i64 -1, align 8

define i32 @main() nounwind {
entry:
  %call = tail call i64 @llabs(i64 undef)
  unreachable
}

define i64 @llabs(i64 %b) noreturn nounwind {
entry:
  tail call void @abort() noreturn nounwind
  unreachable
}

declare void @abort() noreturn

-- 
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