Displaying 1 result from an estimated 1 matches for "signedintegeroverflow".
2015 Aug 11
2
NSW and ExtLdPromotion()
...Here is the reduced testcase:
long long foo(int *a)
{
long long c;
c = *a * 1405;
return c;
}
Clang emitted the following IR (It is done by EmitMUL() in CGExprScalar.cpp,
while
CGF.getLangOpts().getSignedOverflowBehavior()=LangOptions::SOB_Undefined and
CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow)=false):
; Function Attrs: nounwind readonly
define i64 @foo(i32* nocapture readonly %a) #0 {
entry:
%0 = load i32* %a, align 4, !tbaa !1
%mul = mul nsw i32 %0, 1405
%conv = sext i32 %mul to i64
ret i64 %conv
}
Question 1: Is it reasonable to say "mul" is "No S...