public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/48809] [4.4/4.5/4.6/4.7 Regression] switch statement optimization error
Date: Thu, 28 Apr 2011 18:54:00 -0000	[thread overview]
Message-ID: <bug-48809-4-SC9cw1vzoJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-48809-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.04.28 18:50:45
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|---                         |4.4.7
            Summary|switch statement            |[4.4/4.5/4.6/4.7
                   |optimization error          |Regression] switch
                   |                            |statement optimization
                   |                            |error
     Ever Confirmed|0                           |1

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-28 18:50:45 UTC ---
Confirmed, goes away with -fno-tree-switch-conversion.

extern void abort (void);

int
foo (signed char x)
{
  int y = 0;
  switch (x)
    {
    case 0: y = 1; break;
    case 1: y = 2; break;
    case 2: y = 3; break;
    case 3: y = 4; break;
    case 4: y = 5; break;
    case 5: y = 6; break;
    case 6: y = 7; break;
    case 7: y = 8; break;
    case 8: y = 9; break;
    case 9: y = 10; break;
    case 10: y = 11; break;
    case 11: y = 12; break;
    case 12: y = 13; break;
    case 13: y = 14; break;
    case 14: y = 15; break;
    case 15: y = 16; break;
    case 16: y = 17; break;
    case 98: y = 18; break;
    case -62: y = 19; break;
    }
  return y;
}

int
main ()
{
  signed char x = 98;
  if (foo (x) != 18)
    abort ();
}

Will look at it tomorrow.


  parent reply	other threads:[~2011-04-28 18:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-28 18:32 [Bug c++/48809] New: " andrewcmartin at msn dot com
2011-04-28 18:35 ` [Bug c++/48809] " andrewcmartin at msn dot com
2011-04-28 18:36 ` andrewcmartin at msn dot com
2011-04-28 18:39 ` andrewcmartin at msn dot com
2011-04-28 18:54 ` jakub at gcc dot gnu.org [this message]
2011-04-29 13:40 ` [Bug c++/48809] [4.4/4.5/4.6/4.7 Regression] " jakub at gcc dot gnu.org
2011-04-30  6:55 ` jakub at gcc dot gnu.org
2011-04-30  7:01 ` jakub at gcc dot gnu.org
2011-04-30  7:36 ` [Bug c++/48809] [4.4/4.5 " jakub at gcc dot gnu.org
2011-05-03 16:43 ` [Bug testsuite/48809] " jakub at gcc dot gnu.org
2011-05-03 17:21 ` [Bug testsuite/48809] [4.4 " jakub at gcc dot gnu.org
2011-05-04  9:24 ` jakub at gcc dot gnu.org
2011-05-04  9:43 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-48809-4-SC9cw1vzoJ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).