public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <bug-9079-4639@http.gcc.gnu.org/bugzilla/>
@ 2006-07-24 19:41 ` pinskia at gcc dot gnu dot org
2007-07-13 15:47 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-24 19:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from pinskia at gcc dot gnu dot org 2006-07-24 19:41 -------
*** Bug 28470 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gin at mo dot msk dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <bug-9079-4639@http.gcc.gnu.org/bugzilla/>
2006-07-24 19:41 ` [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers pinskia at gcc dot gnu dot org
@ 2007-07-13 15:47 ` pinskia at gcc dot gnu dot org
2008-03-28 2:39 ` rusty at rustcorp dot com dot au
` (4 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-13 15:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from pinskia at gcc dot gnu dot org 2007-07-13 15:46 -------
*** Bug 32751 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rusty at rustcorp dot com
| |dot au
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <bug-9079-4639@http.gcc.gnu.org/bugzilla/>
2006-07-24 19:41 ` [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers pinskia at gcc dot gnu dot org
2007-07-13 15:47 ` pinskia at gcc dot gnu dot org
@ 2008-03-28 2:39 ` rusty at rustcorp dot com dot au
2008-03-28 10:14 ` rguenth at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: rusty at rustcorp dot com dot au @ 2008-03-28 2:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #16 from rusty at rustcorp dot com dot au 2008-03-28 02:38 -------
OK, this is fixed in gcc 4.3 (woot!), but the unused "funk" is still omitted.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35728
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <bug-9079-4639@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2008-03-28 2:39 ` rusty at rustcorp dot com dot au
@ 2008-03-28 10:14 ` rguenth at gcc dot gnu dot org
2008-04-01 14:51 ` jamborm at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-28 10:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #17 from rguenth at gcc dot gnu dot org 2008-03-28 10:13 -------
Note this is only fixed because we run inlining "twice". It isn't fixed
properly in that the new inlining opportunity should be exposed during the
first inlining pass.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <bug-9079-4639@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2008-03-28 10:14 ` rguenth at gcc dot gnu dot org
@ 2008-04-01 14:51 ` jamborm at gcc dot gnu dot org
2008-07-25 17:52 ` jamborm at gcc dot gnu dot org
2008-10-22 15:11 ` jamborm at gcc dot gnu dot org
6 siblings, 0 replies; 16+ messages in thread
From: jamborm at gcc dot gnu dot org @ 2008-04-01 14:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #18 from jamborm at gcc dot gnu dot org 2008-04-01 14:50 -------
I'm now working on a proper fix.
--
jamborm at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jamborm at gcc dot gnu dot
| |org
AssignedTo|unassigned at gcc dot gnu |jamborm at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2006-03-01 02:53:11 |2008-04-01 14:50:54
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <bug-9079-4639@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2008-04-01 14:51 ` jamborm at gcc dot gnu dot org
@ 2008-07-25 17:52 ` jamborm at gcc dot gnu dot org
2008-10-22 15:11 ` jamborm at gcc dot gnu dot org
6 siblings, 0 replies; 16+ messages in thread
From: jamborm at gcc dot gnu dot org @ 2008-07-25 17:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #19 from jamborm at gcc dot gnu dot org 2008-07-25 17:51 -------
As of revision 138092 we are handling this much better.
The example in bug description gets inlined at -O2 even with
-fno-early-inlining.
The example in comment #10 does not work as expected yet. The new
edge is discovered but the always_inline attribute is disregarded and
the inlined does not decide to inline it on its own. I will try to
fix this but it should be noted that few guarantees can be made about
indirect calls to always_inline functions and about always_inline
functions which have their addresses taken in general.
As far as the third example in comment #11 is concerned, the only
problem is loading the target function from the array. The loaded
value is not recognized to be constant early enough to be considered
for inlining. That is really a separate issue though, quite different
from the one originally described. I will have a look at what we can
do earlier but I will close the bug if this is the only outstanding
issue and I don't see an easy fix.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <bug-9079-4639@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2008-07-25 17:52 ` jamborm at gcc dot gnu dot org
@ 2008-10-22 15:11 ` jamborm at gcc dot gnu dot org
6 siblings, 0 replies; 16+ messages in thread
From: jamborm at gcc dot gnu dot org @ 2008-10-22 15:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #20 from jamborm at gcc dot gnu dot org 2008-10-22 15:09 -------
OK, here is the status regarding the trunk (4.4) and the test cases
posted here:
1. The test case in the bug description now works in the sense that
funk is inlined even when not performing early inlining because
both indirect inlining and copy propagation can help the inliner do
this.
2. When compiling the code from comment #10 with indirect inlining
turned on (default on -O2) we end up with (taken from the
"optimized" tree dump):
a (int x)
{
<bb 2>:
if (x != 0)
goto <bb 3>;
else
goto <bb 4>;
<bb 3>:
f (); [tail call]
goto <bb 5>;
<bb 4>:
f (); [tail call]
<bb 5>:
return;
}
Which obviously might be optimized even further but this is no
longer an inlining issue.
3. Finally, let's look at code from comment #11. The function main
still retains one call to foo(), specifically the one that came
from function call(). The reason is that early cpp does not see
the index being constant and thus does not replace the array_ref
directly with the constant. Arguments could be made that cpp
should be run few more times at various places (after ipa-cp, for
example) but IMHO pass ordering would need bigger justification
than this artificial example and this would be very difficult to
implement while also retaining the three phase division of ipa
passes for lto.
Because we are done with all three examples as far as inlining is
concerned, I think this is fixed.
--
jamborm at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <20021228032605.9079.173513@bugs.debian.org>
` (7 preceding siblings ...)
2005-01-23 15:18 ` pinskia at gcc dot gnu dot org
@ 2005-02-12 23:08 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-12 23:08 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <20021228032605.9079.173513@bugs.debian.org>
` (6 preceding siblings ...)
2005-01-23 15:14 ` steven at gcc dot gnu dot org
@ 2005-01-23 15:18 ` pinskia at gcc dot gnu dot org
2005-02-12 23:08 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-23 15:18 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-23 15:17 -------
Again this is different than PR 3713. (steven is closing bugs which are not really fixed or dups right
now).
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|DUPLICATE |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <20021228032605.9079.173513@bugs.debian.org>
` (5 preceding siblings ...)
2004-12-13 22:25 ` sxanth at ceid dot upatras dot gr
@ 2005-01-23 15:14 ` steven at gcc dot gnu dot org
2005-01-23 15:18 ` pinskia at gcc dot gnu dot org
2005-02-12 23:08 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 16+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-01-23 15:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-01-23 15:14 -------
*** This bug has been marked as a duplicate of 3713 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <20021228032605.9079.173513@bugs.debian.org>
` (4 preceding siblings ...)
2004-05-24 11:49 ` pinskia at gcc dot gnu dot org
@ 2004-12-13 22:25 ` sxanth at ceid dot upatras dot gr
2005-01-23 15:14 ` steven at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: sxanth at ceid dot upatras dot gr @ 2004-12-13 22:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sxanth at ceid dot upatras dot gr 2004-12-13 22:25 -------
This is present in 3.4 too
--------------------------------------------
static inline int foo ()
{
return 100;
}
typedef int (*fptr)();
static const fptr a [] = { foo };
static inline int call (int i)
{
return a [i]();
}
static inline int call2 (fptr f)
{
return f();
}
static const fptr F = foo;
int main ()
{
return call (0) + call2 (foo) + F() +foo();
}
---------------------------------------------------
Here only F() and foo() are added at compile time
but it would be better if gcc just returned 400 w/o any other code.
Please fix!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <20021228032605.9079.173513@bugs.debian.org>
` (3 preceding siblings ...)
2004-05-22 18:26 ` pinskia at gcc dot gnu dot org
@ 2004-05-24 11:49 ` pinskia at gcc dot gnu dot org
2004-12-13 22:25 ` sxanth at ceid dot upatras dot gr
` (3 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-24 11:49 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.5.0 |---
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <20021228032605.9079.173513@bugs.debian.org>
` (2 preceding siblings ...)
2004-05-21 1:50 ` cesarb at nitnet dot com dot br
@ 2004-05-22 18:26 ` pinskia at gcc dot gnu dot org
2004-05-24 11:49 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-22 18:26 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|pinskia at gcc dot gnu dot |unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <20021228032605.9079.173513@bugs.debian.org>
2004-05-17 16:52 ` pinskia at gcc dot gnu dot org
2004-05-18 3:54 ` pinskia at gcc dot gnu dot org
@ 2004-05-21 1:50 ` cesarb at nitnet dot com dot br
2004-05-22 18:26 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: cesarb at nitnet dot com dot br @ 2004-05-21 1:50 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cesarb at nitnet dot com dot br 2004-05-20 00:10 -------
I just hit this bug in a hairy piece of code which I reduced to the testcase
below (a should compile to the same thing as expected).
It's the same as this bug but with two layers of indirection instead of one.
#define inline inline __attribute__((always_inline))
#define regparm __attribute__((regparm(3)))
extern void regparm f(void);
static inline void regparm e(void)
{
f();
}
static inline void regparm d(void)
{
f();
}
static inline void regparm c(int x, void (regparm *p1)(void), void (regparm
*p2)(void))
{
if (x)
p1();
else
p2();
}
static inline void regparm b(int x, void (regparm *p)(int x, void (regparm
*p1)(void), void (regparm *p2)(void)))
{
p(x, d, e);
}
void regparm a(int x)
{
b(x, c);
}
void regparm expected(int x __attribute__((unused)))
{
f();
}
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |cesarb at nitnet dot com dot
| |br
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <20021228032605.9079.173513@bugs.debian.org>
2004-05-17 16:52 ` pinskia at gcc dot gnu dot org
@ 2004-05-18 3:54 ` pinskia at gcc dot gnu dot org
2004-05-21 1:50 ` cesarb at nitnet dot com dot br
` (6 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-18 3:54 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-05-17 15:33 -------
The patch which helps is here: <http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00991.html>.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
[not found] <20021228032605.9079.173513@bugs.debian.org>
@ 2004-05-17 16:52 ` pinskia at gcc dot gnu dot org
2004-05-18 3:54 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-17 16:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-05-17 01:32 -------
Patch which also helps it the same way as my cast pass (which I am not going to submit
at all).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2008-10-22 15:11 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-9079-4639@http.gcc.gnu.org/bugzilla/>
2006-07-24 19:41 ` [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers pinskia at gcc dot gnu dot org
2007-07-13 15:47 ` pinskia at gcc dot gnu dot org
2008-03-28 2:39 ` rusty at rustcorp dot com dot au
2008-03-28 10:14 ` rguenth at gcc dot gnu dot org
2008-04-01 14:51 ` jamborm at gcc dot gnu dot org
2008-07-25 17:52 ` jamborm at gcc dot gnu dot org
2008-10-22 15:11 ` jamborm at gcc dot gnu dot org
[not found] <20021228032605.9079.173513@bugs.debian.org>
2004-05-17 16:52 ` pinskia at gcc dot gnu dot org
2004-05-18 3:54 ` pinskia at gcc dot gnu dot org
2004-05-21 1:50 ` cesarb at nitnet dot com dot br
2004-05-22 18:26 ` pinskia at gcc dot gnu dot org
2004-05-24 11:49 ` pinskia at gcc dot gnu dot org
2004-12-13 22:25 ` sxanth at ceid dot upatras dot gr
2005-01-23 15:14 ` steven at gcc dot gnu dot org
2005-01-23 15:18 ` pinskia at gcc dot gnu dot org
2005-02-12 23:08 ` pinskia at gcc dot gnu dot 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).