|
Lines 92-97
static void gfc_init_builtin_functions (
|
Link Here
|
|---|
|
static bool gfc_init (void); | static bool gfc_init (void); |
static void gfc_finish (void); | static void gfc_finish (void); |
static void gfc_print_identifier (FILE *, tree, int); | static void gfc_print_identifier (FILE *, tree, int); |
|
static bool gfc_try_mark_addressable (tree, bool); |
static bool gfc_mark_addressable (tree); | static bool gfc_mark_addressable (tree); |
void do_function_end (void); | void do_function_end (void); |
int global_bindings_p (void); | int global_bindings_p (void); |
|
Lines 108-113
static void gfc_expand_function (tree);
|
Link Here
|
|---|
|
#undef LANG_HOOKS_POST_OPTIONS | #undef LANG_HOOKS_POST_OPTIONS |
#undef LANG_HOOKS_PRINT_IDENTIFIER | #undef LANG_HOOKS_PRINT_IDENTIFIER |
#undef LANG_HOOKS_PARSE_FILE | #undef LANG_HOOKS_PARSE_FILE |
|
#undef LANG_HOOKS_TRY_MARK_ADDRESSABLE |
#undef LANG_HOOKS_MARK_ADDRESSABLE | #undef LANG_HOOKS_MARK_ADDRESSABLE |
#undef LANG_HOOKS_TYPE_FOR_MODE | #undef LANG_HOOKS_TYPE_FOR_MODE |
#undef LANG_HOOKS_TYPE_FOR_SIZE | #undef LANG_HOOKS_TYPE_FOR_SIZE |
|
Lines 126-131
static void gfc_expand_function (tree);
|
Link Here
|
|---|
|
#define LANG_HOOKS_POST_OPTIONS gfc_post_options | #define LANG_HOOKS_POST_OPTIONS gfc_post_options |
#define LANG_HOOKS_PRINT_IDENTIFIER gfc_print_identifier | #define LANG_HOOKS_PRINT_IDENTIFIER gfc_print_identifier |
#define LANG_HOOKS_PARSE_FILE gfc_be_parse_file | #define LANG_HOOKS_PARSE_FILE gfc_be_parse_file |
|
#define LANG_HOOKS_TRY_MARK_ADDRESSABLE gfc_try_mark_addressable |
#define LANG_HOOKS_MARK_ADDRESSABLE gfc_mark_addressable | #define LANG_HOOKS_MARK_ADDRESSABLE gfc_mark_addressable |
#define LANG_HOOKS_TYPE_FOR_MODE gfc_type_for_mode | #define LANG_HOOKS_TYPE_FOR_MODE gfc_type_for_mode |
#define LANG_HOOKS_TYPE_FOR_SIZE gfc_type_for_size | #define LANG_HOOKS_TYPE_FOR_SIZE gfc_type_for_size |
|
Lines 612-620
gfc_init_decl_processing (void)
|
Link Here
|
|---|
|
the TARGET attribute, but we implement it here for a | the TARGET attribute, but we implement it here for a |
likely future Cray pointer extension. | likely future Cray pointer extension. |
Value is 1 if successful. */ | Value is 1 if successful. */ |
|
If CANCEL_REGDECL is set, ignore register declarations for local |
|
variables / parameters unless a specific hard register was requested. |
|
If EMIT_DIAGNOSTICS is set, emit warnings / errors. |
/* TODO: Check/fix mark_addressable. */ | /* TODO: Check/fix mark_addressable. */ |
bool |
/* ??? When diagnostics are requested, we sometimes lie about the success. */ |
gfc_mark_addressable (tree exp) |
static bool |
|
gfc_mark_addressable_internal (tree exp, bool cancel_regdecl, |
|
bool emit_diagnostics) |
{ | { |
register tree x = exp; | register tree x = exp; |
while (1) | while (1) |
|
Lines 640-657
gfc_mark_addressable (tree exp)
|
Link Here
|
|---|
|
{ | { |
if (TREE_PUBLIC (x)) | if (TREE_PUBLIC (x)) |
{ | { |
error |
if (emit_diagnostics) |
("global register variable %qs used in nested function", |
error |
IDENTIFIER_POINTER (DECL_NAME (x))); |
("global register variable %qs used in nested function", |
|
IDENTIFIER_POINTER (DECL_NAME (x))); |
return false; | return false; |
} | } |
pedwarn ("register variable %qs used in nested function", |
if (emit_diagnostics) |
IDENTIFIER_POINTER (DECL_NAME (x))); |
pedwarn ("register variable %qs used in nested function", |
|
IDENTIFIER_POINTER (DECL_NAME (x))); |
} | } |
else if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)) | else if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)) |
{ | { |
if (TREE_PUBLIC (x)) | if (TREE_PUBLIC (x)) |
{ | { |
|
if (!emit_diagnostics) |
|
return false; |
error ("address of global register variable %qs requested", | error ("address of global register variable %qs requested", |
IDENTIFIER_POINTER (DECL_NAME (x))); | IDENTIFIER_POINTER (DECL_NAME (x))); |
return true; | return true; |
|
Lines 670-677
gfc_mark_addressable (tree exp)
|
Link Here
|
|---|
|
} | } |
#endif | #endif |
| |
pedwarn ("address of register variable %qs requested", |
if (emit_diagnostics) |
IDENTIFIER_POINTER (DECL_NAME (x))); |
pedwarn ("address of register variable %qs requested", |
|
IDENTIFIER_POINTER (DECL_NAME (x))); |
|
if (!cancel_regdecl) |
|
return false; |
} | } |
| |
/* drops in */ | /* drops in */ |
|
Lines 683-688
gfc_mark_addressable (tree exp)
|
Link Here
|
|---|
|
} | } |
} | } |
| |
|
static bool |
|
gfc_try_mark_addressable (tree exp, cancel_regdecl) |
|
{ |
|
return gfc_mark_addressable_internal (tree exp, cancel_regdecl, false); |
|
} |
|
|
|
static bool |
|
gfc_mark_addressable (tree exp) |
|
{ |
|
return gfc_mark_addressable_internal (tree exp, true, true); |
|
} |
|
|
/* press the big red button - garbage (ggc) collection is on */ | /* press the big red button - garbage (ggc) collection is on */ |
| |
int ggc_p = 1; | int ggc_p = 1; |