(ALLOCA_FLAGS, ALLOCA_FINISH, AS): Deleted.
authorRichard Stallman <rms@gnu.org>
Wed, 1 Jul 1992 02:20:59 +0000 (02:20 +0000)
committerRichard Stallman <rms@gnu.org>
Wed, 1 Jul 1992 02:20:59 +0000 (02:20 +0000)
(INSTALL): Deleted.
(duplicate_decls): If newdecl for builtin function
has same return mode as the builtin, keep the builtin
but use newdecl's return type.

From-SVN: r1366

gcc/c-decl.c

index 2d6d1e2c189267e305124b0336053dd48b967a56..4cd33a07e6a4b78780b3e4f9e37cd1fc067af6dc 100644 (file)
@@ -1204,6 +1204,19 @@ duplicate_decls (newdecl, olddecl)
          return 0;
        }
       else if (!types_match)
+       {
+          /* Accept the return type of the new declaration if same modes.  */
+         tree oldreturntype = TREE_TYPE (TREE_TYPE (olddecl));
+         tree newreturntype = TREE_TYPE (TREE_TYPE (newdecl));
+          if (TYPE_MODE (oldreturntype) == TYPE_MODE (newreturntype))
+            {
+              TREE_TYPE (TREE_TYPE (olddecl)) = newreturntype;
+              types_match = comptypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl));
+             if (!types_match)
+               TREE_TYPE (TREE_TYPE (olddecl)) = oldreturntype;
+           }
+       }
+      if (!types_match)
        {
          /* If types don't match for a built-in, throw away the built-in.  */
          warning_with_decl (newdecl, "conflicting types for built-in function `%s'");