PR jit/66783 (Re: A possible code generation issue)
David Malcolm
dmalcolm@redhat.com
Thu Jan 1 00:00:00 GMT 2015
On Mon, 2015-07-06 at 22:40 +0100, Dibyendu Majumdar wrote:
> On 6 July 2015 at 22:29, Dibyendu Majumdar <mobile@majumdar.org.uk> wrote:
> > BTW the dump of types is problematic in many ways:
> > 1) types are in wrong order
> > 2) function types are incorrectly output
> > 3) array types are incorrectly output
> > 4) in one case as least a pointer was missing.
>
> Apologies the last point (4) was actually due to a bug in my code -
> but here is what happened.
>
> t->lua_longjumpT = gcc_jit_context_new_opaque_struct(ravi->context, NULL,
> "ravi_lua_longjmp");
> t->plua_longjumpT = gcc_jit_struct_as_type(t->lua_longjumpT);
>
> The plua_longjmpT was meant to be a pointer to the struct.
>
> Surprisingly I was able to use the incomplete type in another struct!
Ouch. Good catch; thanks.
I've filed this specific issue as:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66783
and added it to the tracker bug (PR jit/66627).
> I think this just goes to show that you need to have some form of
> run-time type assertion to detect such issues.
I have a fix for this and the segfault (PR jit/66779) in the works; I
anticipate committing them to trunk tomorrow.
I hope to review the other issues you've raised tomorrow (sorry for not
getting to them today).
Dave
More information about the Jit
mailing list