On Sat, Dec 10, 2011 at 6:23 PM, Eric Botcazou <ebotca...@adacore.com> wrote:
> Hi,
>
> this removes all the occurrences of int64_t in the host code, as well as some
> gratuitous occurrences of int32_t (there are real ones in DFP and LTO code).
> Tested on i586-suse-linux and x86_64-suse-linux.  Any objections?
>
> Are the LTO files present in the gcc directory compiled when LTO is disabled?

Yes they are, but they will be unused at runtime.

> If so, a compiler with a 64-bit type is required on the host since GCC 4.5.0.

-      size = (HOST_BITS_PER_WIDE_INT >= 64)
-       ? (uint64_t) int_size_in_bytes (TREE_TYPE (t))
-       : (((uint64_t) TREE_INT_CST_HIGH (DECL_SIZE_UNIT (t))) << 32)
-               | TREE_INT_CST_LOW (DECL_SIZE_UNIT (t));
+#if HOST_BITS_PER_WIDE_INT >= 64
+      size = (unsigned host_int64) int_size_in_bytes (TREE_TYPE (t));
+#else
+      size
+       = (unsigned host_int64) TREE_INT_CST_HIGH (DECL_SIZE_UNIT (t)) << 32
+         || (unsigned host_int64) TREE_INT_CST_LOW (DECL_SIZE_UNIT (t));
+#endif

and this pattern looks bogus anyway (using TYPE_SIZE vs.
DECL_SIZE).  Please simply switch it to unconditional use of
tree_to_double_int (DECL_SIZE_UNIT (t)).low and make 'size'
a HOST_WIDE_INT (we properly require 64 bit hwi for targets
that have 64bit sizes/pointers).

+#if HOST_BITS_PER_WIDE_INT >= 64
+# define host_int64 HOST_WIDE_INT
+#elif HOST_BITS_PER_WIDEST_INT >= 64
+# define host_int64 HOST_WIDEST_INT
+#else
+# error "host has no 64-bit type"
+#endif

well, as previous communication has shown we should use
HOST_WIDEST_INT unconditionally for a 64-bit type (allowing
the code to compile when no such type is available during stage1).
If we really need a true 64bit type then we should amend hwint.h
accordingly.

Otherwise ok (the s/int32_t/int/ cases are obvious).

Thanks,
Richard.

>
> 2011-12-10  Eric Botcazou  <ebotca...@adacore.com>
>
>        * lto-streamer-out.c (write_symbol): Use proper 64-bit host type.
>        * lto-cgraph.c (input_cgraph_opt_section): Use 'int' for offsets.
>        * lto-streamer-in.c (lto_read_body): Likewise.
>        (lto_input_toplevel_asms): Likewise.
>        * lto-section-in.c (lto_create_simple_input_block): Likewise.
>        * ipa-inline-analysis.c (inline_read_section): Likewise.
>        * ipa-prop.c (ipa_prop_read_section): Likewise.
> lto/
>        * lto.h (lto_parse_hex): Delete.
>        * lto.c (lto_read_decls): Use 'int' for offsets.
>        (lto_parse_hex): Make static and return proper 64-bit host type.
>        (lto_resolution_read): Use proper 64-bit host type.
>
>
> --
> Eric Botcazou

Reply via email to