Re: mspgcc "undefines" too-many-bits shifts in weird way

Paul Sokolovsky <[email protected]>
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.user
Message-ID <20130422021009.3e7f19f5@x34f>
Hello,

On Sun, 21 Apr 2013 17:06:51 -0500
Peter Bigot <[email protected]> wrote:

> This decision was intentional, as documented in
> https://sourceforge.net/p/mspgcc/bugs/118/.  My recollection is that
> the choice of how to make things consistent was informed by similar
> behavior in the contemporaneous gcc for x86 or at least one other
> target architecture.

Thanks for the reference. So, I tested it with x86 gcc 4.4, 4.5, 4.6,
4.7 (packages as shipped by Ubuntu), all of them produce mathematically
expected result. msp430-gcc 4.5.3, 4.7.0 both produce unexpected result.

> As you say, the behavior is undefined.  Anybody who expects any
> particular behavior for this situation is confused about how C works
> and should take the issue up with JTC1/SC22/WG14.

That's why I wrote so many words in the original mail. Yes, in small
world of JTC1/SC22/WG14 C standard the behavior is undefined. But in
much bigger world of: mathematics, well-known gcc targets, user
expectations, principle of least surprise, etc. - it's all pretty well
defined. So, when something is undefined in small area, it's still
a good idea to have affinity towards how it's done/expected in wider
areas. So, the request is just that - please kindly consider changing
that behavior ;-).

> 
> Peter
> 

-- 
Best regards,
 Paul                          mailto:[email protected]

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.