https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71062
--- Comment #2 from joseph at codesourcery dot com <joseph at codesourcery dot com> --- I don't think it's valid to optimize for comparisons, where dereference doesn't occur, based on restrict; restrict is only about how an object is accessed (and as long as the object doesn't get modified, multiple pointers, restricted and otherwise, can be used to access it; it's only if the object is modified[*] that the rules about restrict come into play). [*] Including the deemed modifications from "Every access that modifies X shall be considered also to modify P, for the purposes of this subclause." to deal with multiple levels of restricted pointers.