OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / c-decl.c
index 2a6dcf2..eba6161 100644 (file)
@@ -1775,17 +1775,8 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
         throw it away, in case it was inlined into a function that
         hasn't been written out yet.  */
       if (new_is_definition && DECL_INITIAL (olddecl))
-       {
-         if (TREE_USED (olddecl)
-             /* We never inline re-defined extern inline functions.
-                FIXME: This would be better handled by keeping both functions
-                as separate declarations.  */
-             && cgraph_function_possibly_inlined_p (olddecl))
-           (*debug_hooks->outlining_inline_function) (olddecl);
-
-         /* The new defn must not be inline.  */
-         DECL_UNINLINABLE (newdecl) = 1;
-       }
+       /* The new defn must not be inline.  */
+       DECL_UNINLINABLE (newdecl) = 1;
       else
        {
          /* If either decl says `inline', this fn is inline, unless
@@ -5926,17 +5917,15 @@ finish_enum (tree enumtype, tree values, tree attributes)
          /* The ISO C Standard mandates enumerators to have type int,
             even though the underlying type of an enum type is
             unspecified.  However, GCC allows enumerators of any
-            integer type as an extensions.  Here we convert any
-            enumerators that fit in an int to type int, to avoid
-            promotions to unsigned types when comparing integers with
-            enumerators that fit in the int range.  When -pedantic is
-            given, build_enumerator() would have already warned about
-            those that don't fit.  */
-         if (int_fits_type_p (ini, integer_type_node))
-           tem = integer_type_node;
-         else
-           tem = enumtype;
-         ini = convert (tem, ini);
+            integer type as an extensions.  build_enumerator()
+            converts any enumerators that fit in an int to type int,
+            to avoid promotions to unsigned types when comparing
+            integers with enumerators that fit in the int range.
+            When -pedantic is given, build_enumerator() would have
+            already warned about those that don't fit. Here we
+            convert the rest to the enumerator type. */
+         if (TREE_TYPE (ini) != integer_type_node)
+           ini = convert (enumtype, ini);
 
          DECL_INITIAL (enu) = ini;
          TREE_PURPOSE (pair) = DECL_NAME (enu);
@@ -6026,6 +6015,18 @@ build_enumerator (struct c_enum_contents *the_enum, tree name, tree value,
     pedwarn (value_loc, OPT_pedantic, 
             "ISO C restricts enumerator values to range of %<int%>");
 
+  /* The ISO C Standard mandates enumerators to have type int, even
+     though the underlying type of an enum type is unspecified.
+     However, GCC allows enumerators of any integer type as an
+     extensions.  Here we convert any enumerators that fit in an int
+     to type int, to avoid promotions to unsigned types when comparing
+     integers with enumerators that fit in the int range.  When
+     -pedantic is given, we would have already warned about those that
+     don't fit. We have to do this here rather than in finish_enum
+     because this value may be used to define more enumerators.  */
+  if (int_fits_type_p (value, integer_type_node))
+    value = convert (integer_type_node, value);
+
   /* Set basis for default for next value.  */
   the_enum->enum_next_value
     = build_binary_op