[Bug middle-end/55478] [devirt] trunk fails inline-devirt test #4

hubicka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jan 17 00:42:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55478

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
           Assignee|hubicka at gcc dot gnu.org         |unassigned at gcc dot gnu.org

--- Comment #12 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
print_length is not really a trivial wrapper:
void print_length (const String& string)
{
  for (uint64_t i = 0; i < string.length(); i++)
    {
      printf("%d\n", string.get(i));
    }
}

and the fact that it disappears depends on
 1) ability to inline it
 2) ability to devirtualize length and get calls
 3) ability to eliminate the loop since length is small.

Inlined can anticiapte 1-2 to happen, but not 3 and with -O2 it decides that
code size would grow. 

For 3 one would need return functions to start with to determine the constant
bound. So we can get it better only once Martin gets to it ;)



More information about the Gcc-bugs mailing list