]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
params.def (PARAM_VERIFY_CANONICAL_TYPES): Remove.
authorDouglas Gregor <doug.gregor@gmail.com>
Wed, 11 Jul 2007 13:50:13 +0000 (13:50 +0000)
committerDoug Gregor <dgregor@gcc.gnu.org>
Wed, 11 Jul 2007 13:50:13 +0000 (13:50 +0000)
2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>

       * params.def (PARAM_VERIFY_CANONICAL_TYPES): Remove.
       (PARAM_USE_CANONICAL_TYPES): New; decides whether to use canonical
       types or not.
       * params.h (VERIFY_CANONICAL_TYPES): Remove.
       (USE_CANONICAL_TYPES): New.
       * doc/invoke.texi (verify-canonical-types): Remove.
       (use-canonical-types): Add.

2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>

       * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
       canonical types; otherwise, fall back to structural type
       comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
       internal compiler error if the canonical types are wrong.

From-SVN: r126550

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/doc/invoke.texi
gcc/params.def
gcc/params.h

index a90b025e2d8de26a6a82029e94a53a6dd71d39ac..4a01bbe04c8083d41e7e0c0d69db187f84c628c1 100644 (file)
@@ -1,3 +1,13 @@
+2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>
+
+       * params.def (PARAM_VERIFY_CANONICAL_TYPES): Remove.
+       (PARAM_USE_CANONICAL_TYPES): New; decides whether to use canonical 
+       types or not.
+       * params.h (VERIFY_CANONICAL_TYPES): Remove.
+       (USE_CANONICAL_TYPES): New.
+       * doc/invoke.texi (verify-canonical-types): Remove.
+       (use-canonical-types): Add.
+       
 2007-07-11  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * config/spu/spu.c (spu_optimization_options): Remove setting of
index 3ffc400c1cb9db4212be0e2c575786d5fcd326dc..8165176ae5ede5cc0420d90d07b3991b7a7eec43 100644 (file)
@@ -1,3 +1,10 @@
+2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>
+
+       * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
+       canonical types; otherwise, fall back to structural type
+       comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
+       internal compiler error if the canonical types are wrong.
+       
 2007-07-11  Paolo Carlini  <pcarlini@suse.de>
 
        PR c++/32560
index 3b8b914864e46525c5a4c89a44eaff5afe6b2034..4f08c8e9aa7717778f7710fa3626bbe95a92a67b 100644 (file)
@@ -1108,8 +1108,6 @@ comptypes (tree t1, tree t2, int strict)
 {
   if (strict == COMPARE_STRICT)
     {
-      bool result;
-
       if (t1 == t2)
        return true;
 
@@ -1121,37 +1119,34 @@ comptypes (tree t1, tree t2, int strict)
           perform a deep check. */
        return structural_comptypes (t1, t2, strict);
 
-      if (VERIFY_CANONICAL_TYPES)
+#ifdef ENABLE_CHECKING
+      if (USE_CANONICAL_TYPES)
        {
-         result = structural_comptypes (t1, t2, strict);
-
+         bool result = structural_comptypes (t1, t2, strict);
+         
          if (result && TYPE_CANONICAL (t1) != TYPE_CANONICAL (t2))
-           {
-             /* The two types are structurally equivalent, but their
-                canonical types were different. This is a failure of the
-                canonical type propagation code.*/
-             warning(0,
-                     "canonical types differ for identical types %T and %T", 
-                     t1, t2);
-             debug_tree (t1);
-             debug_tree (t2);
-           }
+           /* The two types are structurally equivalent, but their
+              canonical types were different. This is a failure of the
+              canonical type propagation code.*/
+           internal_error 
+             ("canonical types differ for identical types %T and %T", 
+              t1, t2);
          else if (!result && TYPE_CANONICAL (t1) == TYPE_CANONICAL (t2))
-           {
-             /* Two types are structurally different, but the canonical
-                types are the same. This means we were over-eager in
-                assigning canonical types. */
-             warning (0, 
-                      "same canonical type node for different types %T and %T",
-                      t1, t2);
-             debug_tree (t1);
-             debug_tree (t2);
-           }
+           /* Two types are structurally different, but the canonical
+              types are the same. This means we were over-eager in
+              assigning canonical types. */
+           internal_error 
+             ("same canonical type node for different types %T and %T",
+              t1, t2);
          
          return result;
        }
-      else
+#else
+      if (USE_CANONICAL_TYPES)
        return TYPE_CANONICAL (t1) == TYPE_CANONICAL (t2);
+#endif
+      else
+       return structural_comptypes (t1, t2, strict);
     }
   else if (strict == COMPARE_STRUCTURAL)
     return structural_comptypes (t1, t2, COMPARE_STRICT);
index 6a4bc299c2a0f2aea7a4af549c6fa544e59bde3d..c954b9fe9d5d00f5f34ca93a2082a1e2fecf972f 100644 (file)
@@ -6960,12 +6960,12 @@ The size of cache line in L1 cache, in bytes.
 @item l1-cache-size
 The number of cache lines in L1 cache.
 
-@item verify-canonical-types
-Whether the compiler should verify the ``canonical'' types used for
-type equality comparisons within the C++ and Objective-C++ front
-ends. Set to 1 (the default when GCC is configured with
---enable-checking) to enable verification, 0 to disable verification
-(the default when GCC is configured with --disable-checking).
+@item use-canonical-types
+Whether the compiler should use the ``canonical'' type system.  By
+default, this should always be 1, which uses a more efficient internal
+mechanism for comparing types in C++ and Objective-C++.  However, if
+bugs in the canonical type system are causing compilation failures,
+set this value to 0 to disable canonical types.
 
 @end table
 @end table
index 70ca3ad00c1f98793e14f8fec674b608e150046f..c9d5b8084dd563ccd72637a76e85acb9ce2ddf26 100644 (file)
@@ -673,19 +673,16 @@ DEFPARAM (PARAM_L1_CACHE_LINE_SIZE,
          "The size of L1 cache line",
          32, 0, 0)
 
-#ifdef ENABLE_CHECKING
-# define GCC_CANONICAL_TYPES_DEFAULT 1
-#else
-# define GCC_CANONICAL_TYPES_DEFAULT 0
-#endif
-
-/* Whether we should verify that the canonical types in the system are
-   consistent with the "structural" typing. */
-
-DEFPARAM (PARAM_VERIFY_CANONICAL_TYPES,
-         "verify-canonical-types",
-         "Whether to verify canonical types",
-         GCC_CANONICAL_TYPES_DEFAULT, 0, 1)
+/* Whether we should use canonical types rather than deep "structural"
+   type checking.  Setting this value to 1 (the default) improves
+   compilation performance in the C++ and Objective-C++ front end;
+   this value should only be set to zero to work around bugs in the
+   canonical type system by disabling it.  */
+
+DEFPARAM (PARAM_USE_CANONICAL_TYPES,
+         "use-canonical-types",
+         "Whether to use canonical types",
+         1, 0, 1)
 /*
 Local variables:
 mode:c
index 386e781c26ab7bdd7b1bc81e7a5443f32af261a3..410ae335fe492e1fb0d0fa0a5d17a6a03bc03461 100644 (file)
@@ -168,6 +168,6 @@ typedef enum compiler_param
   PARAM_VALUE (PARAM_L1_CACHE_SIZE)
 #define L1_CACHE_LINE_SIZE \
   PARAM_VALUE (PARAM_L1_CACHE_LINE_SIZE)
-#define VERIFY_CANONICAL_TYPES \
-  PARAM_VALUE (PARAM_VERIFY_CANONICAL_TYPES)
+#define USE_CANONICAL_TYPES \
+  PARAM_VALUE (PARAM_USE_CANONICAL_TYPES)
 #endif /* ! GCC_PARAMS_H */