jit: handle equality of function pointer types
commitf407e6d8aca8b25a57b2985095b8e7033311a603
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Sep 2017 16:00:57 +0000 (28 16:00 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Sep 2017 16:00:57 +0000 (28 16:00 +0000)
tree5896869c2602163e4d7f534581d112054601d4e2
parentd2a5e3d37abeac438673d66a55159a39ce77381c
jit: handle equality of function pointer types

gcc/jit/ChangeLog:
* jit-recording.c
(gcc::jit::recording::function_type::is_same_type_as): New function.
* jit-recording.h: In namespace gcc::jit::recording::
(type::accepts_writes_from): Use is_same_type_as rather than pointer
equality.
(type::is_same_type_as): New virtual function.
(function_type::is_same_type_as): New override.

gcc/testsuite/ChangeLog:
* jit.dg/test-error-mismatching-types-in-assignment-fn-ptr.c: New
test case.
* jit.dg/test-returning-function-ptr.c (create_code): Update to
create a function pointer type independently of the call to
gcc_jit_function_get_address, and assign the pointer to a local
before returning it, to exercise the function pointer type
comparison code.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253255 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/jit/ChangeLog
gcc/jit/jit-recording.c
gcc/jit/jit-recording.h
gcc/testsuite/ChangeLog
gcc/testsuite/jit.dg/test-error-mismatching-types-in-assignment-fn-ptr.c [new file with mode: 0644]
gcc/testsuite/jit.dg/test-returning-function-ptr.c