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]

Re: 64-bit powerpc compare with constant problem


> cc: ben@eecg.toronto.edu, gcc-bugs@gcc.gnu.org
> Date: Sun, 13 Feb 2000 01:23:19 -0500
> From: David Edelsohn <dje@watson.ibm.com>
> 
> 	You did not really address the question.  There are constants from
> the program (either supplied by the programmer or generated by the
> compiler to represent values in the program) and there are constants used
> by the backend of the compiler.  GCC does not distinguish the two in all
> cases.  GCC both knows the width of a word on the host while
> simultaneously extending that host word to the width of the target when it
> thinks that the host value can represent the target value.  I am not
> commenting on whether the optimization is good or bad, but it is a
> decision that makes the current problem rather cumbersome to solve.

It's not an "optimization", it's a bug, caused by people not thinking
about cross-compilation issues when writing code.  Each such bug, when
found, should be fixed, by using the appropriate routines correctly
(like trunc_int_for_mode, plus_constant, and so on).

There are a number of places in the compiler---for instance, in
rs6000_emit_prologue---where the host's types are used to manipulate
target data, like stack offsets, but where this is safe because it is
known that the host's types will be suitable (because we don't support
stack frames larger than a HOST_WIDE_INT, you have to make
HOST_WIDE_INT larger if you need them).  However, when handling
arbitrary constants, this does not work, and thus the problem you are
seeing.

I will look at the bugs reported, and will see if I can't find a solution.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

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