This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix trunk profiledbootstrap in fortran FE
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: fortran at gcc dot gnu dot org
- Date: Wed, 10 Jun 2009 17:26:06 +0200
- Subject: [PATCH] Fix trunk profiledbootstrap in fortran FE
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
The trunk currently fails to profiledbootstrap, due to 3 warnings in the
fortran FE. When building with feedback, gfc_match_generic_spec resp.
gfc_extract_int get inlined into their callers, but gcc isn't able to find
out that op (which is initialized only if INTERFACE_INTRINSIC_OP) is only
used if INTERFACE_INTIRNSIC_OP. This patch initializes the two variables
to avoid the warnings. Also, calling a function in the FE fold_unary
looks like a very bad idea, fold_unary is a middle-end function and e.g.
in the debugger it can cause confusion.
Ok for trunk?
2009-06-10 Jakub Jelinek <jakub@redhat.com>
* interface.c (fold_unary): Rename to...
(gfc_fold_unary): ... this.
(gfc_extend_expr): Adjust caller.
(gfc_match_generic_spec): Likewise. Initialize *op to INTRINSIC_NONE
to avoid warnings.
* expr.c (gfc_replace_expr): Initialize *result to avoid warnings.
--- gcc/fortran/interface.c.jj 2009-05-20 14:10:12.000000000 +0200
+++ gcc/fortran/interface.c 2009-06-10 16:20:26.000000000 +0200
@@ -95,7 +95,7 @@ gfc_free_interface (gfc_interface *intr)
minus respectively, leaving the rest unchanged. */
static gfc_intrinsic_op
-fold_unary (gfc_intrinsic_op op)
+gfc_fold_unary (gfc_intrinsic_op op)
{
switch (op)
{
@@ -136,10 +136,11 @@ gfc_match_generic_spec (interface_type *
if (gfc_match (" operator ( %o )", &i) == MATCH_YES)
{ /* Operator i/f */
*type = INTERFACE_INTRINSIC_OP;
- *op = fold_unary (i);
+ *op = gfc_fold_unary (i);
return MATCH_YES;
}
+ *op = INTRINSIC_NONE;
if (gfc_match (" operator ( ") == MATCH_YES)
{
m = gfc_match_defined_op_name (buffer, 1);
@@ -2482,7 +2483,7 @@ gfc_extend_expr (gfc_expr *e)
actual->next->expr = e->value.op.op2;
}
- i = fold_unary (e->value.op.op);
+ i = gfc_fold_unary (e->value.op.op);
if (i == INTRINSIC_USER)
{
--- gcc/fortran/expr.c.jj 2009-06-08 12:11:09.000000000 +0200
+++ gcc/fortran/expr.c 2009-06-10 16:24:37.000000000 +0200
@@ -253,6 +253,8 @@ gfc_replace_expr (gfc_expr *dest, gfc_ex
const char *
gfc_extract_int (gfc_expr *expr, int *result)
{
+ *result = 0;
+
if (expr->expr_type != EXPR_CONSTANT)
return _("Constant expression required at %C");
Jakub