llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.11k stars 12.01k forks source link

"Register class of operand and regclass of use don't agree!" on x86 glibc atan #1583

Closed llvmbot closed 2 years ago

llvmbot commented 17 years ago
Bugzilla Link 1211
Resolution DUPLICATE
Resolved on Feb 22, 2010 12:51
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor

Extended Description

The following is simplified from the x86 atan2 code in glibc's mathinline.h:

double atan (double x) { register double value; __asm ("fld1; fpatan" : "=t" (value) : "0" (x) : "st(1)"); return value; }

A quite recent llvm-gcc4 barfs on it:

$ gcc -c atan.c cc1: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:364: void llvm::ScheduleDAG::AddOperand(llvm::MachineInstr, llvm::SDOperand, unsigned int, const llvm::TargetInstrDescriptor, llvm::DenseMap<llvm::SDNode*, unsigned int>&): Assertion `RegMap->getRegClass(VReg) == RC && "Register class of operand and regclass of use don't agree!"' failed. atan.c:6: internal compiler error: Aborted Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://llvm.org/bugs> for instructions.

lattner commented 2 years ago

mentioned in issue llvm/llvm-project#1251

lattner commented 17 years ago

Yep, we don't support the X87 FP stack yet. There should be a -D option you can build with to avoid these asms (-DNO_MATH_INLINES ?)

-Chris

This bug has been marked as a duplicate of 879