This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]