This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about type conversion when GCC compile the file?
- From: Nathan Froyd <froydnj at codesourcery dot com>
- To: JCX <jcx721 at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 18 Feb 2009 05:55:43 -0800
- Subject: Re: Question about type conversion when GCC compile the file?
- References: <fe0c0f280902180203u330268b3w6c45e8fb36f5fe37@mail.gmail.com>
On Wed, Feb 18, 2009 at 06:03:58PM +0800, JCX wrote:
> Hello,
> After I compile the following file for testing, I check the dump
> file called "129t.final_cleanup". I doubt about why the type "short
> int" changes into "short unsigned int" during the array operations,
> and at last changes back to "short int" when it stores the result into
> memory.
> [...]
> I don't know why GCC do such a type conversion. Can anyone tell me?
> This makes me more difficult to do the optimization in GCC.
Because GCC converts to short unsigned int to avoid arithmetic