This is the mail archive of the gcc@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]

Re: Bug? flow_find_cross_jump deletes USE insns ...


> Hello,
> 
> a couple of glibc routines are miscompiled on S/390 because
> the cross-jump optimizations remove USE insns after reload.
> 
> The prolog on S/390 generates a USE insn for the GOT register,
> because the GOT pointer must be loaded even if it isn't used
> in the routine (because the PLT stubs rely on the register).

Why exactly do you need the USE instruction? i386 does use similar
scheme (it needs PLT for function calls) and what it does is to
emit explicit USE into each such call.
Alternative is just to maitain flag during code generation whetehr
GOT is needed or not.

It is bit dificult to keep those USE/CLOBBER instructions meaningfull
during compiler and it would be nice to avoid them.

Honza
> 
> This works fine normally, however it can happen that the
> cross-jump optimization pass decides to delete the very first
> insn after the prolog.  If this occurs, there is code in
> flow_find_cross_jump that, as the comment says, tries to
> 'include preceding notes and labels in the cross-junmp'.
> 
> However, it uses the 'active_insn_p' routine to check which preceding
> insns to include.  After reload, this predicate returns false
> not only for notes and labels, but also for USE and CLOBBER insns.
> 
> This means that the GOT register USE insn is killed, and later
> passes then decide to remove the GOT-setting insns as well ...
> 
> Is the use of a USE insn for this purpose (after reload) not
> supported after all?  Or is this a bug in cross-jump optimization?
> 
> 
> Mit freundlichen Gruessen / Best Regards
> 
> Ulrich Weigand
> 
> --
>   Dr. Ulrich Weigand
>   Linux for S/390 Design & Development
>   IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
>   Phone: +49-7031/16-3727   ---   Email: Ulrich.Weigand@de.ibm.com


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