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 middle-end/32044] [4.3 regression] udivdi3 counterproductive, unwarranted use



------- 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


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