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]

[committed] Fix --enable-checking=fold (PR middle-end/38371)


Hi!

The new build_variant_type_copy calls if fold_builtin_memory_op
trigger --enable-checking=fold bootstrap failure, as that function
modifies TYPE_NEXT_VARIANT field of the main variant type and
fold_checksum_tree wasn't allowing that field to change.

Fixed thusly, bootstrapped/regtested with
--enable-languages=c,c++,fortran,java,objc,obj-c++,ada --enable-checking=yes,fold,df,rtl
on x86_64-linux (the only regression from --enable-checking=yes
is that g++.dg/torture/pr31863.C at -O[23s] timed out, given
how expensive fold checking is), committed to trunk as obvious.

2008-12-04  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/38371
	* fold-const.c (fold_checksum_tree): Allow modification of
	TYPE_NEXT_VARIANT.

--- gcc/fold-const.c.jj	2008-12-02 16:27:42.000000000 +0100
+++ gcc/fold-const.c	2008-12-04 00:24:42.000000000 +0100
@@ -13364,9 +13364,11 @@ recursive_label:
       expr = (tree) &buf;
     }
   else if (TREE_CODE_CLASS (code) == tcc_type
-	   && (TYPE_POINTER_TO (expr) || TYPE_REFERENCE_TO (expr)
+	   && (TYPE_POINTER_TO (expr)
+	       || TYPE_REFERENCE_TO (expr)
 	       || TYPE_CACHED_VALUES_P (expr)
-	       || TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr)))
+	       || TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr)
+	       || TYPE_NEXT_VARIANT (expr)))
     {
       /* Allow these fields to be modified.  */
       tree tmp;
@@ -13375,6 +13377,7 @@ recursive_label:
       TYPE_CONTAINS_PLACEHOLDER_INTERNAL (tmp) = 0;
       TYPE_POINTER_TO (tmp) = NULL;
       TYPE_REFERENCE_TO (tmp) = NULL;
+      TYPE_NEXT_VARIANT (tmp) = NULL;
       if (TYPE_CACHED_VALUES_P (tmp))
 	{
 	  TYPE_CACHED_VALUES_P (tmp) = 0;

	Jakub


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