public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/45830] New: [4.4/4.5/4.6 Regression] Code+rodata increase with -ftree-switch-conversion
@ 2010-09-29 15:31 jakub at gcc dot gnu.org
  2010-09-29 15:33 ` [Bug tree-optimization/45830] " rguenth at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-09-29 15:31 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.4/4.5/4.6 Regression] Code+rodata increase with
                    -ftree-switch-conversion
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: jamborm@gcc.gnu.org


int
foo (int *a)
{
  switch (*a)
    {
    case 0:
    case 3:
    case 1:
    case 2:
    case 4:
    case 23:
    case 26:
    case 19:
    case 5:
    case 21:
    case 20:
    case 22:
    case 27:
      return 1;
    default:
      return 0;
    }
}

generates significantly shorter code+rodata with -fno-tree-switch-conversion
than without.  I guess for the cases where 
      if (CASE_USE_BIT_TESTS
          && ! TREE_CONSTANT (index_expr)
          && compare_tree_int (range, GET_MODE_BITSIZE (word_mode)) < 0
          && compare_tree_int (range, 0) > 0
          && lshift_cheap_p ()
          && ((uniq == 1 && count >= 3)
              || (uniq == 2 && count >= 5)
              || (uniq == 3 && count >= 6)))
is true tree-switch-conversion.c should not perform the optimization, and
in any case the question is if the table needs to be created always for the
type of the constants, even when they are integral and would fit into narrower
integer type (like char/unsigned char in this case).


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-07-02 10:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-29 15:31 [Bug ada/45830] New: [4.4/4.5/4.6 Regression] Code+rodata increase with -ftree-switch-conversion jakub at gcc dot gnu.org
2010-09-29 15:33 ` [Bug tree-optimization/45830] " rguenth at gcc dot gnu.org
2010-09-30  9:10 ` pinskia at gcc dot gnu.org
2010-09-30 11:34 ` rguenth at gcc dot gnu.org
2010-10-01 11:49 ` jakub at gcc dot gnu.org
2010-11-19 16:18 ` jakub at gcc dot gnu.org
2010-11-19 23:50 ` jakub at gcc dot gnu.org
2010-11-19 23:54 ` [Bug tree-optimization/45830] [4.4/4.5 " jakub at gcc dot gnu.org
2011-04-16  9:59 ` jakub at gcc dot gnu.org
2011-12-12 20:52 ` gjl at gcc dot gnu.org
2012-03-13 14:46 ` [Bug tree-optimization/45830] [4.5 " jakub at gcc dot gnu.org
2012-04-18 20:35 ` steven at gcc dot gnu.org
2012-07-02 10:40 ` rguenth at gcc dot gnu.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).