------- Additional Comments From schlie at comcast dot net  2004-10-20 21:46 -------
Subject: Re:  usual arithmetic conversion not applying
 correctly

Andrew,

And if it's already declared as, or cast to signed char's in the code?

unsigned char x, y ;

(signed char)x = (signed char)x / (signed char)y ;

-or- (should yield identical code, and require no promotions or conversions)

signed char x, y ; 

x = x / y ; the only arguable possible type conversion that may be required
          ; would be to convert the result of (x / y) which may have been
          ; implemented by the target machine as having a wider result, but
          ; not required if it's destination storage does not require it.

 (there's no reason to ever muck with specified object types unless it's
  value needs to converted as required for assignment, or the specified
  semantics of an operation; but even then, the type of the object doesn't
  change, although the its value's representation may if required.)

-paul-

> From: pinskia at gcc dot gnu dot org <[EMAIL PROTECTED]>
> Reply-To: <[EMAIL PROTECTED]>
> Date: 20 Oct 2004 19:54:55 -0000
> To: <[EMAIL PROTECTED]>
> Subject: [Bug c/18065] usual arithmetic conversion not applying correctly
> 
> 
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-20
> 19:54 -------
> When I am talking about promoting means that we add casts. aka sc%sc gets
> changed to (signed char)
> (((int)sc)%((int)sc)).
> 
> -- 
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18065
> 
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.




-- 


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

Reply via email to