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 tree-optimization/49642] constant part of a macro not optimized away as expected due to splitter


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


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