This is the mail archive of the gcc@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]

Uncessary long long produced in tree-ssa?


Hello,
I noticed in some cases GCC 4.3.0 produces unnecessary long long data
type in tree ssa form. It results in inefficient 64-bit arithmetic in
our porting. 

Original C code

void main(int *a, int *b, int *c, int j){
  int i;
  for(i = 0; i <= 4; i++){
    int tx = j  + i;
    a[i] = b[tx] + c[i];
  }
}  

.final_cleanup

;; Function main (main)

main (a, b, c, j)
{
  long unsigned int D.1759;
  long long unsigned int ivtmp.19;

<bb 2>:
  ivtmp.19 = 0;

<bb 3>:
  D.1759 = (long unsigned int) ivtmp.19 * 4;
  MEM[base: a, index: D.1759] = MEM[base: c, index: D.1759] + MEM[base:
b + (long unsigned int) j * 4, index: D.1759];
  ivtmp.19 = ivtmp.19 + 1;
  if (ivtmp.19 != 5)
    goto <bb 3>;
  else
    goto <bb 4>;

<bb 4>:
  return;

}

Is it necessary to use "long long unsigned" ivtmp.19 here?  It would
require 64-bit addition in the loop. 


Cheers,
Bingfeng Mei
Broadcom UK 


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