public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PING] set libfunc entry for sdivmod_optab to NULL in optabs.def
@ 2016-09-09 22:05 Prathamesh Kulkarni
  2016-09-15  0:21 ` Richard Sandiford
  0 siblings, 1 reply; 8+ messages in thread
From: Prathamesh Kulkarni @ 2016-09-09 22:05 UTC (permalink / raw)
  To: gcc Patches, Richard Sandiford

Hi,
I would like to ping the following patch:
https://gcc.gnu.org/ml/gcc-patches/2016-08/msg01015.html

While implementing divmod transform:
https://gcc.gnu.org/ml/gcc-patches/2016-05/msg01757.html

I ran into an  issue with optab_libfunc().
It appears optab_libfunc (sdivmod_optab, mode) returns
bogus libfunc for unsupported modes, for instance
on x86_64, optab_libfunc (sdivmod_optab, DImode) returns
a libfunc with name "__divmoddi4", even though such a libfunc
does not exist in libgcc. This happens because in optabs.def
the libfunc entry for sdivmod_optab has gen_int_libfunc,
and call to optab_libfunc (sdivmo_optab, DImode) lazily
creates a bogus libfunc "__divmoddi4" by calling gen_int_libfunc().

To work around this issue I set libfunc entry for sdivmod_optab to NULL
and verified that optab_libfunc (sdivmod_optab, DImode) returns NULL_RTX
instead of a bogus libfunc if it's not overriden by the target.

Bootstrapped and tested on ppc64le-linux-gnu, x86_64-linux-gnu.
Cross tested on arm*-*-*, aarch64*-*-*.
OK for trunk ?

Thanks,
Prathamesh

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-09-16 11:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-09 22:05 [PING] set libfunc entry for sdivmod_optab to NULL in optabs.def Prathamesh Kulkarni
2016-09-15  0:21 ` Richard Sandiford
2016-09-15  3:08   ` Richard Sandiford
2016-09-15 10:53     ` Prathamesh Kulkarni
2016-09-15 12:12       ` Richard Sandiford
2016-09-15 12:16         ` Prathamesh Kulkarni
2016-09-15 12:42           ` Richard Biener
2016-09-16 11:31             ` Prathamesh Kulkarni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).