This is the mail archive of the gcc-patches@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]

Re: [PATCH] Avoid printing host INT_MIN as raw digits


On Fri, Dec 19, 2003 at 10:13:59AM -0800, Zack Weinberg wrote:
> > I originally wrote something similar to that, but Zack insisted it be
> > implemented differently so it will work properly when configured for a
> > Canadian cross on a 32-bit build machine to a 64-bit host machine.
> 
> I haven't seen the rest of the thread yet, but yeah.  The problem case
> for this code is the other way round: 64-bit build machine, 32-bit
> host.  Then if the value is -(2**31), this code will not detect it as
> a problem (because HOST_WIDE_INT on the *build* machine is 64 bits, so
> it only considers -(2**63) to be a problem) but the emitted constant
> will still hit the problem case when it's compiled for the *host*,
> with 32-bit HOST_WIDE_INT.
> 
> Note also that you're printing the _build machine_'s HOST_WIDE_INT
> suffix on the constant, which may be wrong for the host.

Huh.  In which case canadian cross is all mucked up, and the bits
here don't really break things any more than they're already broke.

I would think it wouldn't be too difficult to make sure that H_W_I
matched in width for build and host.  To the extent that a 64-bit 
build machine doesn't *have* to use a 64-bit H_W_I type, and a 
32-bit build machine *must* have a 64-bit H_W_I type if we're
using a 64-bit host machine.

Further, the printing macros that we have should be distinguished
for "current" machine or the host machine.

I'm not going to clean any of this up myself.


r~


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