Re: Why does GCC convert short operation to short unsigned?

2011-06-17 Thread Richard Guenther
On Fri, Jun 17, 2011 at 12:56 PM, Paul Koning wrote: > > On Jun 17, 2011, at 5:26 AM, Richard Guenther wrote: > >> On Fri, Jun 17, 2011 at 11:14 AM, Bingfeng Mei wrote: >>> Hi, >>> I noticed that GCC converts short arithmetic to unsigned short. >>> >>> short foo2 (short a, short b) >>> { >>>  ret

Re: Why does GCC convert short operation to short unsigned?

2011-06-17 Thread Paul Koning
On Jun 17, 2011, at 5:26 AM, Richard Guenther wrote: > On Fri, Jun 17, 2011 at 11:14 AM, Bingfeng Mei wrote: >> Hi, >> I noticed that GCC converts short arithmetic to unsigned short. >> >> short foo2 (short a, short b) >> { >> return a - b; >> } >> >> In .gimple file: >> >> foo2 (short int a

Re: Why does GCC convert short operation to short unsigned?

2011-06-17 Thread Richard Guenther
On Fri, Jun 17, 2011 at 11:14 AM, Bingfeng Mei wrote: > Hi, > I noticed that GCC converts short arithmetic to unsigned short. > > short foo2 (short a, short b) > { >  return a - b; > } > > In .gimple file: > > foo2 (short int a, short int b) > { >  short int D.3347; >  short unsigned int a.0; >  s

Why does GCC convert short operation to short unsigned?

2011-06-17 Thread Bingfeng Mei
Hi, I noticed that GCC converts short arithmetic to unsigned short. short foo2 (short a, short b) { return a - b; } In .gimple file: foo2 (short int a, short int b) { short int D.3347; short unsigned int a.0; short unsigned int b.1; short unsigned int D.3350; a.0 = (short unsigned i