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 target/19293] avr-gcc crashes when using shifts with negative shift count


------- Additional Comments From joseph at codesourcery dot com  2005-01-06 18:03 -------
Subject: Re:  avr-gcc crashes when using shifts with negative
 shift count

On Thu, 6 Jan 2005, bjoern dot m dot haase at web dot de wrote:

> It seems that the standard says that shift operations with negative shift count 
> are supposed to yield an "unspecified" result. 

Undefined, not unspecified.

> Is there some more specific convention for gcc on how to behave in these cases? 

For some other cases of runtime undefined behavior we generate an abort 
(with a warning that we are doing so).  This is what we do for va_arg with 
types changed by the default argument promotions, and for calls to 
functions cast to incompatible types.  We could do it for negative or 
too-wide shifts as well if we wish, either generally or for the specific 
targets for which they are problems.



-- 


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


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