Created attachment 44628 [details] Preprocessed file which produces clobbering warning I am getting the following warning from code, compiling with -Os -Wclobbered src/read.c: In function ‘EvalRef.isra.25’: cc1: warning: argument ‘ISRA.312’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered] EvalRef is defined as: static UInt EvalRef(const LHSRef ref, Int needExpr) Which fdump-tree-all, preprocess.c.225t.switchlower shows as: EvalRef.isra.25 (const REFTYPE ISRA.310, const UInt ISRA.311, const UInt ISRA.312, Int needExpr) So, there are (I feel) two issues. Firstly, the warning isn't helpful as it references a gcc-introduced function. Also I still don't see how ISRA.312 could get clobbered, as it is const. Unfortunately I have tried and failed to produce a small reproducable case of this. I attach a preprocessed source file, made with gcc 8.0.1 on Ubuntu 18.04, from the current master branch of https://www.github.com/gap-system/gap
Confirmed. I think the warning tells you that the ISRA.312 when not spilled to the stack by the compiler, might be not properly restored. That it is 'const' doesn't really matter. Given the source passes an aggregate by value depending on the ABI you might get the very same bad effect. Eventually we can do better with this warning and only warn when we actually failed to spill the register. I think the warning for arguments is usually a false positive since argument registers are call-clobbered. Given we use setjmp_crosses for the warning I wonder why we do not use that to guide register allocation ...