[Bug middle-end/16187] extra casts to unsigned int generated for array references

dann at godzilla dot ics dot uci dot edu gcc-bugzilla@gcc.gnu.org
Fri Jun 25 22:58:00 GMT 2004


------- Additional Comments From dann at godzilla dot ics dot uci dot edu  2004-06-25 22:47 -------
The cast to unsigned int is generated by c-common.c:pointer_int_sum

See the difference in the gimple code generated for the following 2 functions:

int f1(int *  data, int j) | int f1(int *  data, unsigned int j)
{                            {
      return  data[j];             return  data[j];
}                            }

  j.1 = (unsigned int)j;   |   T.1 = j * 4;
  T.2 = j.1 * 4;           |   T.2 = (int *)T.1;
  T.3 = (int *)T.2;        |   T.3 = T.2 + data;
  T.4 = T.3 + data;        |   T.0 = *T.3;
  T.0 = *T.4;              <
  return T.0;                  return T.0;

The first case generates one extra gimple statement.


-- 


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



More information about the Gcc-bugs mailing list