public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/35295]  New: 64-bit host cross compile to 32-bit target differs from 32-bit host cross compile to 32-bit target
@ 2008-02-22 14:19 benny at ammitzboell-consult dot dk
  2008-02-22 14:39 ` [Bug c/35295] " rguenth at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: benny at ammitzboell-consult dot dk @ 2008-02-22 14:19 UTC (permalink / raw)
  To: gcc-bugs

We are cross-compiling to a 32-bit ARM target from both 32-bit and 64-bit PCs.
The  gcc cross-compiler toolchain (3.4.6) generates valid code in both cases,
but the generated code is larger when a 64-bit host is used. We have tracked
this down to the following:

1) The RTL is using 64-bit (on the 64-bit host) to represent constants that is
calculated as part of the code-generation. Perhaps because print-rtl.c is using
HOST_WIDE_INT_xxx in some places. Surely any kind of constant number even in
high level RTL should be using the *target* int size and not the host?
2) The 64-bit constants are treated as such and thus generates more assembler
instructions to deal with the 64-bit number on the 32-bit target.

We have fixed the toolchain with a workaround where "-m32" is used to compile
the entire toolchain as 32-bit, but I think the correct solution would be to
ensure that constants used in the RTL are represented using the target format
in stead of the host.

As far as I can see from the code (print-rtl.c) the problem is still there in
gcc 4.2.3.


-- 
           Summary: 64-bit host cross compile to 32-bit target differs from
                    32-bit host cross compile to 32-bit target
           Product: gcc
           Version: 3.4.6
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: benny at ammitzboell-consult dot dk
 GCC build triplet: i686-pc-linux-gnu / x86_64-unknown-linux-gnu
  GCC host triplet: i686-pc-linux-gnu / x86_64-unknown-linux-gnu
GCC target triplet: arm-uclinux-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35295


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-05-20  7:34 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-22 14:19 [Bug c/35295] New: 64-bit host cross compile to 32-bit target differs from 32-bit host cross compile to 32-bit target benny at ammitzboell-consult dot dk
2008-02-22 14:39 ` [Bug c/35295] " rguenth at gcc dot gnu dot org
2008-02-22 17:59 ` [Bug middle-end/35295] " pinskia at gcc dot gnu dot org
2008-02-25 14:10 ` benny at ammitzboell-consult dot dk
2008-02-25 14:14 ` benny at ammitzboell-consult dot dk
2008-02-25 14:15 ` benny at ammitzboell-consult dot dk
2008-02-25 14:22 ` benny at ammitzboell-consult dot dk
2008-02-25 14:23 ` benny at ammitzboell-consult dot dk
2008-02-25 14:27 ` benny at ammitzboell-consult dot dk
2008-02-25 14:32 ` benny at ammitzboell-consult dot dk
2008-02-25 15:44 ` [Bug target/35295] " rguenth at gcc dot gnu dot org
2008-02-25 16:03 ` benny at ammitzboell-consult dot dk
2008-02-28  8:19 ` benny at ammitzboell-consult dot dk
2008-05-20  7:33 ` benny at ammitzboell-consult dot dk
2008-05-20  7:34 ` benny at ammitzboell-consult dot dk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).