public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][LTO] Re-set boolean_type_node in free_lang_data
@ 2009-07-10 19:30 Richard Guenther
  2009-07-10 19:33 ` Diego Novillo
  2009-10-12 10:14 ` Eric Botcazou
  0 siblings, 2 replies; 24+ messages in thread
From: Richard Guenther @ 2009-07-10 19:30 UTC (permalink / raw)
  To: GCC Patches, Diego Novillo

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

The following fixes ICEs in convert_move that happen because Fortrans idea of
boolean_type_node doesn't match up with lto1s.  It's a hack added alongside
the other hacks, and shouldn't change anything for C/C++.

But I'll take this as a chance to bootstrap lto bootstrapping/testing.  Well, as
soon as I can get back to a fast machine.

Ok for lto if that works?

Thanks,
Richard.

2009-07-10  Richard Guenther  <rguenther@suse.de>

        * tree.c (free_lang_data): Re-set boolean_type_node to what
        it will be for lto1.

[-- Attachment #2: fix-lto-fortran-4 --]
[-- Type: application/octet-stream, Size: 1336 bytes --]

2009-07-10  Richard Guenther  <rguenther@suse.de>

	* tree.c (free_lang_data): Re-set boolean_type_node to what
	it will be for lto1.

Index: gcc/tree.c
===================================================================
--- gcc/tree.c	(revision 149476)
+++ gcc/tree.c	(working copy)
@@ -4744,6 +4744,22 @@ free_lang_data (void)
      a variant copy of ptr_type_node for front-end purposes.  */
   fileptr_type_node = ptr_type_node;
 
+  /* FIXME lto.  This is a hack.  boolean_type_node is set to
+     a frontend-specific mode by Fortran and Java at least.  */
+  if (TREE_CODE (boolean_type_node) != BOOLEAN_TYPE
+      || (TYPE_MODE (boolean_type_node)
+	  != mode_for_size (BOOL_TYPE_SIZE, MODE_INT, 0))
+      || TYPE_PRECISION (boolean_type_node) != 1
+      || !TYPE_UNSIGNED (boolean_type_node))
+    {
+      boolean_type_node = make_unsigned_type (BOOL_TYPE_SIZE);
+      TREE_SET_CODE (boolean_type_node, BOOLEAN_TYPE);
+      TYPE_MAX_VALUE (boolean_type_node) = build_int_cst (boolean_type_node, 1);
+      TYPE_PRECISION (boolean_type_node) = 1;
+      boolean_false_node = TYPE_MIN_VALUE (boolean_type_node);
+      boolean_true_node = TYPE_MAX_VALUE (boolean_type_node);
+    }
+
   /* Reset some langhooks.  */
   lang_hooks.callgraph.analyze_expr = NULL;
   lang_hooks.types_compatible_p = gimple_types_compatible_p;

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

end of thread, other threads:[~2009-10-15 19:22 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-10 19:30 [PATCH][LTO] Re-set boolean_type_node in free_lang_data Richard Guenther
2009-07-10 19:33 ` Diego Novillo
2009-10-12 10:14 ` Eric Botcazou
2009-10-12 10:28   ` Richard Guenther
2009-10-12 11:22     ` Eric Botcazou
2009-10-12 11:45       ` Richard Guenther
2009-10-12 12:22         ` Eric Botcazou
2009-10-12 13:09           ` Richard Guenther
2009-10-13  6:16             ` Eric Botcazou
2009-10-13  9:35               ` Richard Guenther
2009-10-14 12:09                 ` Eric Botcazou
2009-10-14 12:46                   ` Richard Guenther
2009-10-14 20:58                     ` Eric Botcazou
2009-10-14 21:24                       ` Richard Guenther
2009-10-15 13:28                         ` Eric Botcazou
2009-10-14 21:49                       ` Rafael Espindola
2009-10-15 13:30                         ` Eric Botcazou
2009-10-15 13:47                           ` Richard Guenther
2009-10-15 14:23                             ` Eric Botcazou
2009-10-15 14:38                               ` Richard Guenther
2009-10-15 19:27                                 ` Eric Botcazou
2009-10-15 15:10                           ` Rafael Espindola
2009-10-14 22:23                       ` Diego Novillo
2009-10-15 13:39                         ` Eric Botcazou

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).