https://bugs.llvm.org/show_bug.cgi?id=40890
Bug ID: 40890
Summary: After r349561, Assertion failed: (EVResult.Val.isInt()
&& "Expression did not evaluate to integer"), function
EvaluateKnownConstInt, file
tools/clang/lib/AST/ExprConstant.cpp, line 11056.
Product: new-bugs
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
After https://reviews.llvm.org/rL349561 ("Emit ASM input in a constant
context"), valgrind's getoffset.c file no longer compiles, with an assertion:
Assertion failed: (EVResult.Val.isInt() && "Expression did not evaluate to
integer"), function EvaluateKnownConstInt, file
/home/dim/src/llvm/trunk/tools/clang/lib/AST/ExprConstant.cpp, line 11056.
This is due to the rather awful (but necessary) __asm__ construct here:
https://sourceware.org/git/?p=valgrind.git;a=blob;f=VEX/auxprogs/genoffsets.c;h=1f680e4f6cbe51fb9a71af3a9e291699794a40da;hb=HEAD#l70
#define GENOFFSET(_structUppercase,_structLowercase,_fieldname) \
__asm__ __volatile__ ( \
"\n#define OFFSET_" \
VG_STRINGIFY(_structLowercase) "_" \
VG_STRINGIFY(_fieldname) \
" xyzzy%0\n" : /*out*/ \
: /*in*/ "n" \
(my_offsetof(VexGuest##_structUppercase##State, \
guest_##_fieldname)) \
)
[...]
void foo ( void )
{
// x86
GENOFFSET(X86,x86,EAX);
GENOFFSET(X86,x86,EBX);
and so on.
Minimized, this becomes:
/* clang -cc1 -triple x86_64-- -S genoffsets-min.c */
typedef struct {
unsigned guest_EAX;
} VexGuestX86State;
void foo(void)
{
__asm__ __volatile__ (
"\n#define OFFSET_x86_EAX xyzzy%0\n"
:
: "n" (&((VexGuestX86State*)0)->guest_EAX)
);
}
This is a regression from clang 7.0.0 and 7.0.1, which would compile this
construct just fine.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs