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 target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4


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

--- Comment #15 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #14)
> I was trying to understand what's happening there ... it's a bit confusing. 
> A cleaner way would probably be to add a function in final.c to update the
> cached length value for the INSN_UID in final.c.  Then, invoke that function
> for the insn in fixup_mova when the pattern rtx is changed from
> casesi_worker_1 to casesi_worker_2.  However, I guess that all the other
> insn length dependent values will have to be re-calculated to get a
> consistent state.

The usual way to re-compute insn length is shorten_branches.  I'm
not sure that new function is a good idea or not.  It looks a too
big hammer for this corner case on one specific target.
sh_reorg calls shorten_branches after the loop which includes
find_barrier call and get_attr_length will return correct value
after that.
It looks too costly to call shorten_branches for the rare case
in the loop.  I'll look for another point to call shorten_branches
which can fix the issue.

> Wouldn't it be easier/safer to just set the length of casesi_worker_1 to "8"?

It may be safest from the computational viewpoint, though it'll
affect almost existing pic codes, I'm afraid.  Perhaps it's OK
for trunk.  The above patch won't affect existing code except
very limited cases, though it's a bit tricky.


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