Committed, MMIX: Fix 64-bit host (opcodes/mmix-opc.c)

Daniel Jacobowitz drow@false.org
Sun Mar 20 05:53:00 GMT 2005


On Sat, Mar 19, 2005 at 11:00:03AM -0800, H. J. Lu wrote:
> On Sat, Mar 19, 2005 at 01:36:54PM -0500, Daniel Jacobowitz wrote:
> > On Sat, Mar 19, 2005 at 10:33:22AM -0800, H. J. Lu wrote:
> > > On Fri, Mar 18, 2005 at 11:30:41PM -0500, Hans-Peter Nilsson wrote:
> > > > On Fri, 18 Mar 2005, H. J. Lu wrote:
> > > > > Please make sure that there are no unexpected failures in gas.
> > > > 
> > > > That's what I meant of course.  Now it does; if there are any
> > > > related ld failures they disappear in the breakage due to empty
> > > > size section removal.
> > > > 
> > > > (For the record, the value of (X << 24) where X=0xff depends on
> > > > the size of int and the type of the expression.  Easiest fixed
> > > > by forcing the type of X.)
> > > > 
> > > > I'll commit this to 2.16 too.
> > > > 
> > > > 	* mmix-opc.c (O, Z): Force expression as unsigned long.
> > > > 
> > > 
> > > It isn't enough. I checked in the following patch to mainline to
> > > fix it. I suggest you check it to 2.16 branch.
> > 
> > Why do you believe the type of the shift count matters here?
> > 
> > > -#define O(m) ((unsigned long) (m) << 24UL), ((~(unsigned long) (m) & 255) << 24)
> > > +#define O(m) ((unsigned long) (m) << 24UL), ((~(unsigned long) (m) & 255) << 24UL)
> > 
> 
> Without that change, mmix doesn't work on x86_64.

The C language seems to disagree with you.  Please provide an example.

The type of an << operation is the (promoted) type of the left operand;
the type of the right operand is generally irrelevant.

-- 
Daniel Jacobowitz
CodeSourcery, LLC



More information about the Binutils mailing list