https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71598
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> --- Created attachment 45973 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45973&action=edit patch I am testing I am testing the following. I needed to adjust the testcase a bit to make the C++ FE happy, in particular casting the arguments to the function to pointer-to-enum type and storing an enum member rather than an integer (the conversion on the return stmts seems to work): enum e1 { c1 }; __attribute__((noinline,noclone)) int f(enum e1 *p, unsigned *q) { *p = c1; *q = 2; return *p; } int main() { unsigned x; if (f((enum e1 *)&x, &x) != 2) __builtin_abort(); return 0; }