This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug jit/64722] On 2nd time libgccjit is run in-process on i686, generated code clobbers %ebx register


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64722

--- Comment #8 from Ilya Enkovich <enkovich.gnu at gmail dot com> ---
different hooks(In reply to Jakub Jelinek from comment #5)
> Can you explain it?  Usually when this function is called,
> pic_offset_table_rtx is NULL and your i386.h macro relies on that.
> When initializing default target during initialization it is NULL of course,
> and apparently even in target_reinit, when it is called with freshly cleared
> heap object for the non-default target.
> It is just when jit calls the initialization again without clearing all the
> variables...
> So I believe my proposed change is correct.
> 
> In any case, perhaps jit shouldn't reinitialize everything all the time, at
> least if the compilation options don't change.

I misunderstood places when init_emit_regs is called and my fix is incorrect.

It is still unclear to me how this initialization affects generated code.  IIRC
we let pic_offset_table_rtx be EBX only because of middle-end which calls
target hooks for code cost estimations.  In this case we needed some valid pic
reg to generate RTL for its estimation and EBX was used.  But in target code
pic_offset_table_rtx is initialized with pseudo register and value set in
init_emit_regs shouldn't matter.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]