This is the mail archive of the
mailing list for the GCC project.
Re: help for arm avr bfin cris frv h8300 m68k mcore mmix pdp11 rs6000 sh vax
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Bernd Schmidt <bernds_cb1 at t-online dot de>, Paolo Bonzini <bonzini at gnu dot org>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, richard dot earnshaw at arm dot com, hp at axis dot com, aldyh at redhat dot com, aoliva at redhat dot com, law at redhat dot com, nickc at redhat dot com, kazu at codesourcery dot com, ni1d at arrl dot net, kkojima at gcc dot gnu dot org, matt at 3am-software dot com
- Date: Fri, 13 Mar 2009 18:26:45 +0000 (UTC)
- Subject: Re: help for arm avr bfin cris frv h8300 m68k mcore mmix pdp11 rs6000 sh vax
- References: <email@example.com> <49BA5C4A.firstname.lastname@example.org> <email@example.com> <Pine.LNX.firstname.lastname@example.org> <email@example.com>
On Fri, 13 Mar 2009, Richard Guenther wrote:
> Last time I sent a patch to remove the SHIFT_COUNT_TRUNCATED check
> from fold-const.c the reason that this was rejected was that we want to
> be consistend with target behavior...
I would disagree with such a rejection. If we want to provide any sort of
consistency I think it should be optional (an option like -fwrapv) and
define the semantics at the language level rather than depending on the
> > As I understand it, SHIFT_COUNT_TRUNCATED is about the semantics of RTL,
> > and has no bearing on the implemented semantics of any source language or
> > of GENERIC or GIMPLE; GENERIC and GIMPLE both follow the rule that
> > out-of-range shifts (or rotates?), including those by negative amounts,
> > are undefined.
> "Undefined" is a bad semantic for GIMPLE. If the frontends want the middle-end
> to take advantage of undefinedness it needs to translate it to a useful defined
By undefined I mean that the middle-end may assume that the value is
within range [0, number of value and sign bits in type) and transform on
the basis of that assumption (including value range propagation).
Joseph S. Myers