public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/15473] New: [tree-ssa] Sibcall optimization for libcalls.
@ 2004-05-17 0:47 kazu at cs dot umass dot edu
2004-05-17 0:57 ` [Bug tree-optimization/15473] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-05-17 0:47 UTC (permalink / raw)
To: gcc-bugs
Consider:
long long
foo (long long a, long long b)
{
return a / b;
}
I get:
foo (a, b)
{
<bb 0>:
return a_1 / b_2;
}
with the assembly code being
foo:
subl $12, %esp
pushl 28(%esp)
pushl 28(%esp)
pushl 28(%esp)
pushl 28(%esp)
call __divdi3
addl $28, %esp
ret
Note that the sequence of 4 pushl instructions simply copy 16 bytes
from one location of the stack to another.
If I create a (non-libcall) function with the same arguments like so
long long div64 (long long a, long long b);
long long
bar (long long a, long long b)
{
return div64 (a, b);
}
I get:
bar (a, b)
{
long long int T.0;
<bb 0>:
T.0_3 = div64 (a_1, b_2) [tail call];
return T.0_3;
}
with the assembly code being
bar:
jmp div64
--
Summary: [tree-ssa] Sibcall optimization for libcalls.
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Keywords: pessimizes-code
Severity: enhancement
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kazu at cs dot umass dot edu
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15473
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <bug-15473-5009@http.gcc.gnu.org/bugzilla/>]
* [Bug rtl-optimization/15473] Sibcall optimization for libcalls.
[not found] <bug-15473-5009@http.gcc.gnu.org/bugzilla/>
@ 2007-09-03 13:25 ` chrbr at gcc dot gnu dot org
2007-10-09 8:36 ` chrbr at gcc dot gnu dot org
1 sibling, 0 replies; 8+ messages in thread
From: chrbr at gcc dot gnu dot org @ 2007-09-03 13:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from chrbr at gcc dot gnu dot org 2007-09-03 13:24 -------
this report is quite old, but worth to pop :
We found similar problems with implicit memory block copying when using struct
copying by value. (frequent in C++ )
Softfloat architectures making a very extensive use of libcalls are also very
sensitive to this lost optimisation (it is a performance regression since the
optimisation was correctly done with a gcc 3.4.3). The rtl was then emitted
both for normal calls and sibling calls and stored in a "placeholder". The
placeholder was decided to be emitted after all the stmts were expanded. Since
gcc 4.0 the placeholders have disapeared so we lost the ability to optimise
libcalls in the backend.
I will try to make use of the cfg information available in expand to decide if
we can pass BLOCK_OP_TAILCALL to emit_block_move. I expect that libcalls can
share the same interface.
--
chrbr at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |chrbr at gcc dot gnu dot org
Last reconfirmed|2006-03-01 02:40:48 |2007-09-03 13:24:57
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15473
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug rtl-optimization/15473] Sibcall optimization for libcalls.
[not found] <bug-15473-5009@http.gcc.gnu.org/bugzilla/>
2007-09-03 13:25 ` chrbr at gcc dot gnu dot org
@ 2007-10-09 8:36 ` chrbr at gcc dot gnu dot org
1 sibling, 0 replies; 8+ messages in thread
From: chrbr at gcc dot gnu dot org @ 2007-10-09 8:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from chrbr at gcc dot gnu dot org 2007-10-09 08:36 -------
*** Bug 32684 has been marked as a duplicate of this bug. ***
--
chrbr at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15473
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <bug-15473-4@http.gcc.gnu.org/bugzilla/>]
* [Bug rtl-optimization/15473] Sibcall optimization for libcalls.
[not found] <bug-15473-4@http.gcc.gnu.org/bugzilla/>
@ 2015-09-08 13:03 ` hjl.tools at gmail dot com
2021-08-14 9:43 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2015-09-08 13:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15473
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl.tools at gmail dot com
Version|4.0.0 |6.0
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
Some libcalls are expanded in
static rtx
expand_builtin_unop (machine_mode target_mode, tree exp, rtx target,
rtx subtarget, optab op_optab)
{
rtx op0;
if (!validate_arglist (exp, INTEGER_TYPE, VOID_TYPE))
return NULL_RTX;
/* Compute the argument. */
op0 = expand_expr (CALL_EXPR_ARG (exp, 0),
(subtarget
&& (TYPE_MODE (TREE_TYPE (CALL_EXPR_ARG (exp, 0)))
== GET_MODE (subtarget))) ? subtarget : NULL_RTX,
VOIDmode, EXPAND_NORMAL);
/* Compute op, into TARGET if possible.
Set TARGET to wherever the result comes back. */
target = expand_unop (TYPE_MODE (TREE_TYPE (CALL_EXPR_ARG (exp, 0))),
op_optab, op0, target, op_optab != clrsb_optab);
gcc_assert (target);
return convert_to_mode (target_mode, target, 0);
}
which doesn't go through expand_call.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug rtl-optimization/15473] Sibcall optimization for libcalls.
[not found] <bug-15473-4@http.gcc.gnu.org/bugzilla/>
2015-09-08 13:03 ` hjl.tools at gmail dot com
@ 2021-08-14 9:43 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-14 9:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15473
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |nsz at gcc dot gnu.org
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 95966 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-08-14 9:43 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-17 0:47 [Bug tree-optimization/15473] New: [tree-ssa] Sibcall optimization for libcalls kazu at cs dot umass dot edu
2004-05-17 0:57 ` [Bug tree-optimization/15473] " pinskia at gcc dot gnu dot org
2004-05-17 19:33 ` [Bug rtl-optimization/15473] " steven at gcc dot gnu dot org
2004-08-16 0:19 ` pinskia at gcc dot gnu dot org
[not found] <bug-15473-5009@http.gcc.gnu.org/bugzilla/>
2007-09-03 13:25 ` chrbr at gcc dot gnu dot org
2007-10-09 8:36 ` chrbr at gcc dot gnu dot org
[not found] <bug-15473-4@http.gcc.gnu.org/bugzilla/>
2015-09-08 13:03 ` hjl.tools at gmail dot com
2021-08-14 9:43 ` pinskia at gcc dot gnu.org
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).