On Thu, Sep 30, 2021 at 04:46:47PM +0200, Frédéric Bonnard wrote: > Not sure what optimization breaks, I just tried changing openat() to > modify some aggressive optimization on that function and it helped.
The optimization seems to break with -O1, but not with -O0 -fcombine-stack-adjustments -fcompare-elim -fcprop-registers -fdefer-pop -fforward-propagate -fguess-branch-probability -fipa-profile -fipa-pure-const -fipa-reference -fipa-reference-addressable -fmerge-constants -fomit-frame-pointer -freorder-blocks -fshrink-wrap -fsplit-wide-types -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-coalesce-vars -ftree-copy-prop -ftree-dce -ftree-dominator-opts -ftree-fre -ftree-sink -ftree-slsr -ftree-ter -fbranch-count-reg -fdelayed-branch -fdse -fif-conversion -fif-conversion2 -finline-functions-called-once -fmove-loop-invariants -fssa-phiopt -fipa-modref -ftree-bit-ccp -ftree-dse -ftree-pta -ftree-sra It also seems fine at -O2 if fprintf(stderr, "%i, %s, %x\n", dir_fd, pathname, flags); is called prior to next_openat.