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

Reply via email to