handle DM_CONST, lower inline limit, force optimize_funccalls
authorMatthias Braun <matze@braunis.de>
Tue, 23 Sep 2008 14:57:08 +0000 (14:57 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 23 Sep 2008 14:57:08 +0000 (14:57 +0000)
[r22210]

ast2firm.c
ast_t.h
driver/firm_opt.c
parser.c

index 924ca8a..6c47533 100644 (file)
@@ -1047,6 +1047,9 @@ static void handle_gnu_attributes_ent(ir_entity *ent, declaration_t *decl)
                   __attribute__((pure)) specifier. */
                set_entity_additional_property(ent, mtp_property_pure);
        }
+       if (decl->modifiers & DM_CONST) {
+               set_entity_additional_property(ent, mtp_property_const);
+       }
        if (decl->modifiers & DM_USED) {
                /* TRUE if the declaration includes the GNU
                   __attribute__((used)) specifier. */
diff --git a/ast_t.h b/ast_t.h
index d062191..0b7f9f6 100644 (file)
--- a/ast_t.h
+++ b/ast_t.h
@@ -536,16 +536,17 @@ typedef enum decl_modifier_t {
        DM_NOALIAS           = 1 << 12,
        DM_PACKED            = 1 << 13,
        DM_TRANSPARENT_UNION = 1 << 14,
-       DM_PURE              = 1 << 15,
-       DM_CONSTRUCTOR       = 1 << 16,
-       DM_DESTRUCTOR        = 1 << 17,
-       DM_UNUSED            = 1 << 18,
-       DM_USED              = 1 << 19,
-       DM_CDECL             = 1 << 20,
-       DM_FASTCALL          = 1 << 21,
-       DM_STDCALL           = 1 << 22,
-       DM_THISCALL          = 1 << 23,
-       DM_DEPRECATED        = 1 << 24
+       DM_CONST             = 1 << 15,
+       DM_PURE              = 1 << 16,
+       DM_CONSTRUCTOR       = 1 << 17,
+       DM_DESTRUCTOR        = 1 << 18,
+       DM_UNUSED            = 1 << 19,
+       DM_USED              = 1 << 20,
+       DM_CDECL             = 1 << 21,
+       DM_FASTCALL          = 1 << 22,
+       DM_STDCALL           = 1 << 23,
+       DM_THISCALL          = 1 << 24,
+       DM_DEPRECATED        = 1 << 25
 } decl_modifier_t;
 
 typedef unsigned decl_modifiers_t;
index 12ee99a..ed28ec9 100644 (file)
@@ -303,7 +303,7 @@ static int firm_const_exists;
 
 static void do_optimize_funccalls(void)
 {
-       optimize_funccalls(firm_const_exists, NULL);
+       optimize_funccalls(true, NULL);
 }
 
 static void do_gcse(ir_graph *irg)
@@ -331,7 +331,7 @@ static void do_stred(ir_graph *irg)
 
 static void do_inline(void)
 {
-       inline_functions(500, 50);
+       inline_functions(500, 0);
 }
 
 static void do_cloning(void)
index cbc9c3d..685efcd 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1658,7 +1658,6 @@ static decl_modifiers_t parse_gnu_attribute(gnu_attribute_t **attributes)
                                }
 
                                switch(kind) {
-                               case GNU_AK_CONST:
                                case GNU_AK_VOLATILE:
                                case GNU_AK_NAKED:
                                case GNU_AK_MALLOC:
@@ -1698,6 +1697,7 @@ static decl_modifiers_t parse_gnu_attribute(gnu_attribute_t **attributes)
                                case GNU_AK_UNUSED:            modifiers |= DM_UNUSED;            goto no_arg;
                                case GNU_AK_USED:              modifiers |= DM_USED;              goto no_arg;
                                case GNU_AK_PURE:              modifiers |= DM_PURE;              goto no_arg;
+                               case GNU_AK_CONST:             modifiers |= DM_CONST;             goto no_arg;
                                case GNU_AK_ALWAYS_INLINE:     modifiers |= DM_FORCEINLINE;       goto no_arg;
                                case GNU_AK_DLLIMPORT:         modifiers |= DM_DLLIMPORT;         goto no_arg;
                                case GNU_AK_DLLEXPORT:         modifiers |= DM_DLLEXPORT;         goto no_arg;