David Malcolm (dmalcolm) <[email protected]> approved the changes:
Thanks for the patch.

Note that `handle_transaction_pure_attribute` is only used by libgccjit 
(c-attribs.cc uses `handle_tm_attribute`) so this probably shouldn't be in the 
shared file.

The patch introduces some minor behavior changes to libgccjit for the 
following, but I believe only `"pure"`, `"const"` and `"returns_twice"` are 
currently reachable (based on `fn_attribute_to_string` in jit-playback.cc)

* "pure" in libgccjit with a non-FUNCTION_DECL used to ICE with gcc_unreachable 
but now emits a warning.  Would be an improvement.
* "pure" in libgccjit with a void-returning function (e.g. via 
GCC_JIT_FN_ATTRIBUTE_PURE) now warns when it didn't before.  This could lead to 
previously-compiling gcc_jit_contexts failing after the patch.  A behavior 
change, but I don't think it's a problem.
* "const" in libgccjit on a void-returning function (e.g. via 
GCC_JIT_FN_ATTRIBUTE_CONST): gains a warning, so a similar behavior change.  I 
think it's OK, for the same reasons.
* "returns_twice" in libgccjit on a non-FUNCTION-DECL used to ICE with 
gcc_unreachable but now emits a warning (an improvement); not reachable from 
public jit API
* "nothrow" same as "returns_twice", but reachable from API for builtins

dummy-frontend.cc can lose its definition of ATTR_EXCL after this patch (but we 
can defer this to a followup).

So I think this is OK from my POV, but @jsm28 might want you to drop the move 
of `handle_transaction_pure_attribute`.   Patch is probably good enough as-is 
if this has already been tested thoroughly (bootstrap + make check-jit; 
check-gcc/check-c++), given how much of a pain this is causing you.  Hence 
marking as "approved" but note the above.



--
https://forge.sourceware.org/gcc/gcc/pulls/207#issuecomment-7615

Reply via email to