This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/49642] constant part of a macro not optimized away as expected due to splitter
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 5 Jul 2011 12:59:37 +0000
- Subject: [Bug tree-optimization/49642] constant part of a macro not optimized away as expected due to splitter
- Auto-submitted: auto-generated
- References: <bug-49642-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49642
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.07.05 12:59:02
CC| |hubicka at gcc dot gnu.org
Component|c |tree-optimization
Version|tree-ssa |4.6.1
Ever Confirmed|0 |1
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-05 12:59:02 UTC ---
Confirmed.
Honza - we split a __builtin_constant_p guarded section away, not killing off
the not needed constant case as we process final optimizations in the wrong
order (thus we don't see the function is unused soon enough).
I think it isn't a good idea to split away any code dominated by such
call. The testcase is basically
int foo(int arg)
{
if (__builtin_constant_p (arg))
{
if (arg == 10)
return 1;
return unreachable ();
}
return arg;
}
and we split it as
int foo (int arg)
{
if (__builtin_constant_p (arg))
return foo.part (arg);
return arg;
}