flâneur — a map of the web's best reading

What Every C Programmer Should Know About Undefined Behavior #1/3 - The LLVM Project Blog

blog.llvm.org · 1,853 words · saved by 1 readers

People occasionally ask why LLVM-compiled code sometimes generates SIGTRAP signals when the optimizer is turned on. After digging in, they find that Clang generated a "ud2" instruction (assuming X86 code) - the same as is generated by __builtin_trap().

What Every C Programmer Should Know About Undefined Behavior #1/3 By Chris Lattner May 13, 2011 #optimization , #Clang 9 minute read People occasionally ask why LLVM-compiled code sometimes generates SIGTRAP signals when the optimizer is turned on. After digging in, they find that Clang generated a "ud2" instruction (assuming X86 code) - the same as is generated by __builtin_trap(). There are several issues at work here, all centering around undefined behavior in C code and how LLVM handles it. This blog post (the first in a series of three) tries to explain some of these issues so that you ca

Explore this link on the map →

saved by

related reading