summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-22 15:22:04 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-22 15:22:04 +0000
commit79e0cff74052972ae3794cdb4791864d406d16ec (patch)
tree21b476dfc623e3356f62e5f133c7927ccbfccdc1 /gcc/fortran
parent84972db5b3f112ca1c838dc3bd7b2f333b99adea (diff)
downloadgcc-79e0cff74052972ae3794cdb4791864d406d16ec.tar.gz
2012-09-22 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 191642 using svnmerge. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@191643 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog17
-rw-r--r--gcc/fortran/cpp.c6
-rw-r--r--gcc/fortran/dependency.c33
-rw-r--r--gcc/fortran/trans-decl.c10
4 files changed, 34 insertions, 32 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 3552ffc4d4a..983d305419d 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,20 @@
+2012-09-22 Thomas König <tkoenig@gcc.gnu.org>
+
+ PR fortran/54599
+ * dependency.c (gfc_dep_compare_expr): Clarify logic,
+ remove dead code.
+
+2012-09-20 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/54599
+ * cpp.c (print_line): Properly handle extern C.
+
+2012-09-20 Martin Jambor <mjambor@suse.cz>
+
+ * trans-decl.c (gfc_get_extern_function_decl): Push NULL cfun. Do not
+ set and restore current_function_decl.
+ (gfc_init_coarray_decl): Do not set and restore current_function_decl.
+
2012-09-17 Tobias Burnus <burnus@net-b.de>
PR fortran/54608
diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c
index 2f18893313b..c45af39ef61 100644
--- a/gcc/fortran/cpp.c
+++ b/gcc/fortran/cpp.c
@@ -822,6 +822,7 @@ print_line (source_location src_loc, const char *special_flags)
size_t to_file_len;
unsigned char *to_file_quoted;
unsigned char *p;
+ int sysp;
loc = expand_location (src_loc);
to_file_len = strlen (loc.file);
@@ -838,9 +839,10 @@ print_line (source_location src_loc, const char *special_flags)
print.src_line == 0 ? 1 : print.src_line,
to_file_quoted, special_flags);
- if (loc.sysp == 2)
+ sysp = in_system_header_at (src_loc);
+ if (sysp == 2)
fputs (" 3 4", print.outf);
- else if (loc.sysp == 1)
+ else if (sysp == 1)
fputs (" 3", print.outf);
putc ('\n', print.outf);
diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c
index 165ab4f0abb..7c9525ac805 100644
--- a/gcc/fortran/dependency.c
+++ b/gcc/fortran/dependency.c
@@ -395,30 +395,21 @@ gfc_dep_compare_expr (gfc_expr *e1, gfc_expr *e2)
l = gfc_dep_compare_expr (e1->value.op.op1, e2->value.op.op1);
r = gfc_dep_compare_expr (e1->value.op.op2, e2->value.op.op2);
- if (l <= -2)
+ if (l != 0)
return l;
- if (l == 0)
- {
- /* Watch out for 'A ' // x vs. 'A' // x. */
- gfc_expr *e1_left = e1->value.op.op1;
- gfc_expr *e2_left = e2->value.op.op1;
-
- if (e1_left->expr_type == EXPR_CONSTANT
- && e2_left->expr_type == EXPR_CONSTANT
- && e1_left->value.character.length
- != e2_left->value.character.length)
- return -2;
- else
- return r;
- }
+ /* Left expressions of // compare equal, but
+ watch out for 'A ' // x vs. 'A' // x. */
+ gfc_expr *e1_left = e1->value.op.op1;
+ gfc_expr *e2_left = e2->value.op.op1;
+
+ if (e1_left->expr_type == EXPR_CONSTANT
+ && e2_left->expr_type == EXPR_CONSTANT
+ && e1_left->value.character.length
+ != e2_left->value.character.length)
+ return -2;
else
- {
- if (l != 0)
- return l;
- else
- return r;
- }
+ return r;
}
/* Compare X vs. X-C, for INTEGER only. */
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 53c248d963b..910b1500fdc 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1630,17 +1630,14 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
/* By construction, the external function cannot be
a contained procedure. */
locus old_loc;
- tree save_fn_decl = current_function_decl;
- current_function_decl = NULL_TREE;
gfc_save_backend_locus (&old_loc);
- push_cfun (cfun);
+ push_cfun (NULL);
gfc_create_function_decl (gsym->ns, true);
pop_cfun ();
gfc_restore_backend_locus (&old_loc);
- current_function_decl = save_fn_decl;
}
/* If the namespace has entries, the proc_name is the
@@ -4861,16 +4858,12 @@ add_argument_checking (stmtblock_t *block, gfc_symbol *sym)
void
gfc_init_coarray_decl (bool main_tu)
{
- tree save_fn_decl;
-
if (gfc_option.coarray != GFC_FCOARRAY_LIB)
return;
if (gfort_gvar_caf_this_image || gfort_gvar_caf_num_images)
return;
- save_fn_decl = current_function_decl;
- current_function_decl = NULL_TREE;
push_cfun (cfun);
gfort_gvar_caf_this_image
@@ -4906,7 +4899,6 @@ gfc_init_coarray_decl (bool main_tu)
pushdecl_top_level (gfort_gvar_caf_num_images);
pop_cfun ();
- current_function_decl = save_fn_decl;
}