[Bug optimization/15242] pessimization of "goto *"

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu May 6 04:45:00 GMT 2004


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-06 04:45 -------
Confirmed a reduced testcase:
int f(int i, int j)
{
  static void *a[5] = {&&b,&&c,&&d,&&e,&&f};

    if (i >=5) i = 0; if (i<=0)i=5;
    goto *a[i];
  e:
    i++;  if (i >=5) i = 0; if (i<=0)i=5;
    j++;
    goto *a[i];
  f:
    i--;  if (i >=5) i = 0; if (i<=0)i=5;
    j--;
    goto *a[i];
  b:
    i+=2;  if (i >=5) i = 0; if (i<=0)i=5;
    goto *a[i];
  c:
    i*=2;  if (i >=5) i = 0; if (i<=0)i=5;
    goto *a[i];
  d:;
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-05-06 04:45:35
               date|                            |


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



More information about the Gcc-bugs mailing list