This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/32044] [4.3 regression] udivdi3 counterproductive, unwarranted use
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Nov 2007 14:22:48 -0000
- Subject: [Bug middle-end/32044] [4.3 regression] udivdi3 counterproductive, unwarranted use
- References: <bug-32044-11706@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #19 from manu at gcc dot gnu dot org 2007-11-08 14:22 -------
(In reply to comment #16)
> One possible solution would be to annotate the division by the expected value
> of the result. Division expanders then may decide whether to expand to machine
> instruction/libcall or to check for small values of the result in if-guards
> first.
>
Well, that won't achieve at all what the user wants, that is, to not get a call
to __udividi3.
There are 2 issues here:
1) GCC replaces the loop by division. This may or may not be more efficient. In
this case, it is not. In many other cases, it is.
2) The user does not want a call to __udividi3.
If I understand correctly you need __udividi3 to do the division, am I wrong?
Of course, you could "inline" it or link statically to avoid libgcc. The former
will pessimize the code in most cases and the latter can be done by the user.
Tricky. Is it possible to fix (2) without fixing (1)?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32044