Author: regehr

  • Isolating a Free-Range Miscompilation

    If we say that a compiler is buggy, we need to be able to back up that claim with reproducible, compelling, and understandable evidence. Usually, this evidence centers on a test case that triggers the buggy behavior; we’ll say something like “given this test case, compiler A produces an executable that prints 0 whereas compiler…

  • Obelisk

    Classes start next week so I sneaked out for a quick hike on Tuesday, climbing a minor local peak that is informally called The Obelisk. This one had eluded me for years so it felt nice to finally stand on top. Summitpost says “Obelisk is rarely climbed during the summer and provides ample solitude,” and…

  • A Month of Invalid GCC Bug Reports, and How to Eliminate Some of Them

    During July 2016 the GCC developers marked 38 bug reports as INVALID. Here’s the full list. They fall into these (subjective) categories: 8 bug reports stemmed from undefined behavior in the test case (71753, 71780, 71803, 71813, 71885, 71955, 71957, 71746) 1 bug report was complaining about UB exploitation in general (71892) 15 bug reports…

  • Perseids

    Matthew Flatt, my 9 year old son, and I stayed out last night watching the Perseid meteor shower. To find some dark skies we drove out to the Utah-Nevada border, along the way passing a sign that said “NEXT GAS 130 MILES” — always a good sign on a road trip. We arrived around 12:30…

  • C-Reduce 2.5

    In May we released C-Reduce 2.5 which builds against LLVM/Clang 3.8. New in this release: Improved reduction of non-preprocessed C/C++ code. C-Reduce now includes #included files that are below a certain size and also uses unifdef to remove #ifdef/#endif pairs. Specialization of #define directives is not implemented yet. Support for reducing multiple files at once.…

  • Pointer Overflow Checking

    Most programming languages have a lot of restrictions on the kinds of pointers that programs can create. C and C++ are unusually permissive in this respect: pointers to arbitrary objects and subobjects, usually all the way down to bytes, can be constructed. Consequently, most address computations can be expressed either in terms of integer arithmetic…

  • Teaching C

    The other day Neel Krishnaswami mentioned that he’s going to be teaching the C class at Cambridge in the fall, and asked if I had any advice about that topic. Of course I do! In fact the response got so long that it ended up being a blog post. My main idea is that we…

  • Checking Up on Dataflow Analyses

    An important tool for reasoning about programs without running them is dataflow analysis, which can be used to compute facts such as: an integer-valued variable is non-negative at a particular program point a conditional branch always goes one way an indirect write cannot modify a particular array Dataflow facts drive optimizations such as constant propagation…

  • Efficient Integer Overflow Checking in LLVM

    (Here’s some optional background reading material.) We want fast integer overflow checking. Why? First, if the undefined behavior sanitizers go faster then testing goes faster. Second, when overhead drops below a certain point people will become willing to use UBSan to harden production code against integer overflows. This is already being done in parts of…

  • Happy Canyon

    Happy Canyon

    I’ve been doing a poor job of taking pictures in Europe. On the other hand, I’ve had a trip report on the back burner since last spring, so let’s look at a few pictures from that. Happy Canyon, in a remote part of southeast Utah, has a scenic and non-technical narrow section that would be…