- 
                Notifications
    
You must be signed in to change notification settings  - Fork 15.1k
 
Closed
Labels
backend:X86bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behavior
Description
target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128"
target triple = "i386-unknown-linux-gnu"
define void @test(ptr %0) {
  %2 = alloca [10 x i8], i32 0, align 1
  %3 = ptrtoint ptr %2 to i32
  %4 = add i32 %3, 2147483647
  br label %5
5:                                                ; preds = %5, %1
  %6 = phi i32 [ 0, %1 ], [ %7, %5 ]
  %7 = add i32 %6, 1
  %8 = icmp eq i32 %6, %4
  br label %5
]with llc compiled with UBSan
> llc out.ll
.../llvm-project/llvm/lib/Target/X86/X86RegisterInfo.cpp:945:27: runtime error: signed integer overflow: 3 + 2147483647 cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior .../llvm-project/llvm/lib/Target/X86/X86RegisterInfo.cpp:945:27 inI can reproduce this on f17e766
Metadata
Metadata
Assignees
Labels
backend:X86bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behavior