[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The output of gcc_jit_context_dump_to_file() is missing parenthesis in expressions involving casts
On Sun, 2015-06-14 at 20:11 +0100, Dibyendu Majumdar wrote:
> It seems that in some cases the output is not showing parenthesis
> where it should.
Yes, this is a bug.
The dumping fns are somewhat hacky; they have no concept of C precedence
order, and are probably misleading on some expressions. Sorry.
I've filed it as:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66539
> For instance:
>
> if ((struct ravi_LClosure *)L->ci->func->p->sizep > (int)0)
>
>
> The cast is to be applied to L->ci->func - so this expression should
> be in parenthesis.
>
> gcc_jit_rvalue *rvalue__struct_ravi_LClosure___L__ci__func_0xae4e10 =
> gcc_jit_context_new_cast (ctxt_0xae4350,
> NULL, /* gcc_jit_location *loc */
> gcc_jit_lvalue_as_rvalue
> (lvalue_L__ci__func_0xae4b90), /* gcc_jit_rvalue *rvalue */
>
> gcc_jit_lvalue *lvalue__struct_ravi_LClosure___L__ci__func__p_0xae4fd0=
> gcc_jit_rvalue_dereference_field
> (rvalue__struct_ravi_LClosure___L__ci__func_0xae4e10, /*
> gcc_jit_rvalue *ptr */
> NULL, /* gcc_jit_location *loc */
> field_p_0xacf1d0); /*
> gcc_jit_field *field */
>
> gcc_jit_lvalue *lvalue__struct_ravi_LClosure___L__ci__func__p__k_0xae5020=
> gcc_jit_rvalue_dereference_field (gcc_jit_lvalue_as_rvalue
> (lvalue__struct_ravi_LClosure___L__ci__func__p_0xae4fd0), /*
> gcc_jit_rvalue *ptr */
> NULL, /* gcc_jit_location *loc */
> field_k_0xacdc10); /*
> gcc_jit_field *field */