aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog15
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/parse.c40
-rw-r--r--gcc/genemit.c20
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/builtins.c7
-rw-r--r--gcc/java/expr.c3
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.dg/builtin-choose-expr.c2
-rw-r--r--gcc/testsuite/gcc.dg/dfp/composite-type.c7
-rw-r--r--gcc/testsuite/gcc.dg/trunc-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/vla-9.c1
-rw-r--r--gcc/tree-flow.h8
-rw-r--r--gcc/tree-outof-ssa.c10
-rw-r--r--gcc/tree-ssa-operands.h5
-rw-r--r--gcc/tree-ssa-pre.c8
-rw-r--r--gcc/tree.c4
-rw-r--r--gcc/tree.h4
18 files changed, 88 insertions, 66 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2a6c593..1f32f76 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,18 @@
+2010-04-07 Jakub Jelinek <jakub@redhat.com>
+
+ * tree-ssa-pre.c (my_rev_post_order_compute): Remove set but not
+ used count variable.
+ * genemit.c (gen_expand, gen_split): Avoid set but not used warnings
+ when operandN variables aren't used in the body of the expander
+ or splitter.
+ * tree-outof-ssa.c (FOR_EACH_ELIM_GRAPH_SUCC,
+ FOR_EACH_ELIM_GRAPH_PRED): Avoid set but not used warnings.
+ * tree-ssa-operands.h (FOR_EACH_SSA_TREE_OPERAND): Likewise.
+ * tree-flow.h (FOR_EACH_IMM_USE_FAST, FOR_EACH_IMM_USE_STMT,
+ FOR_EACH_IMM_USE_ON_STMT): Likewise.
+ * tree.h (FOR_EACH_CONSTRUCTOR_ELT): Likewise.
+ * tree.c (PROCESS_ARG): Likewise.
+
2010-04-07 Simon Baldwin <simonb@google.com>
* diagnostic.h (diagnostic_override_option_index): New macro to
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 1f46730..795eeb5 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-07 Jakub Jelinek <jakub@redhat.com>
+
+ * parse.c (parse_derived, parse_enum): Avoid set but not used
+ warning.
+
2010-04-07 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/40539
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 190148c..ef8931d 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -1968,14 +1968,12 @@ parse_derived_contains (void)
static void
parse_derived (void)
{
- int compiling_type, seen_private, seen_sequence, seen_component, error_flag;
+ int compiling_type, seen_private, seen_sequence, seen_component;
gfc_statement st;
gfc_state_data s;
gfc_symbol *sym;
gfc_component *c;
- error_flag = 0;
-
accept_statement (ST_DERIVED_DECL);
push_state (&s, COMP_DERIVED, gfc_new_block);
@@ -2002,18 +2000,15 @@ parse_derived (void)
case ST_FINAL:
gfc_error ("FINAL declaration at %C must be inside CONTAINS");
- error_flag = 1;
break;
case ST_END_TYPE:
endType:
compiling_type = 0;
- if (!seen_component
- && (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Derived type "
- "definition at %C without components")
- == FAILURE))
- error_flag = 1;
+ if (!seen_component)
+ gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Derived type "
+ "definition at %C without components");
accept_statement (ST_END_TYPE);
break;
@@ -2023,7 +2018,6 @@ endType:
{
gfc_error ("PRIVATE statement in TYPE at %C must be inside "
"a MODULE");
- error_flag = 1;
break;
}
@@ -2031,15 +2025,11 @@ endType:
{
gfc_error ("PRIVATE statement at %C must precede "
"structure components");
- error_flag = 1;
break;
}
if (seen_private)
- {
- gfc_error ("Duplicate PRIVATE statement at %C");
- error_flag = 1;
- }
+ gfc_error ("Duplicate PRIVATE statement at %C");
s.sym->component_access = ACCESS_PRIVATE;
@@ -2052,7 +2042,6 @@ endType:
{
gfc_error ("SEQUENCE statement at %C must precede "
"structure components");
- error_flag = 1;
break;
}
@@ -2063,7 +2052,6 @@ endType:
if (seen_sequence)
{
gfc_error ("Duplicate SEQUENCE statement at %C");
- error_flag = 1;
}
seen_sequence = 1;
@@ -2072,14 +2060,12 @@ endType:
break;
case ST_CONTAINS:
- if (gfc_notify_std (GFC_STD_F2003,
- "Fortran 2003: CONTAINS block in derived type"
- " definition at %C") == FAILURE)
- error_flag = 1;
+ gfc_notify_std (GFC_STD_F2003,
+ "Fortran 2003: CONTAINS block in derived type"
+ " definition at %C");
accept_statement (ST_CONTAINS);
- if (parse_derived_contains ())
- error_flag = 1;
+ parse_derived_contains ();
goto endType;
default:
@@ -2138,14 +2124,11 @@ endType:
static void
parse_enum (void)
{
- int error_flag;
gfc_statement st;
int compiling_enum;
gfc_state_data s;
int seen_enumerator = 0;
- error_flag = 0;
-
push_state (&s, COMP_ENUM, gfc_new_block);
compiling_enum = 1;
@@ -2167,10 +2150,7 @@ parse_enum (void)
case ST_END_ENUM:
compiling_enum = 0;
if (!seen_enumerator)
- {
- gfc_error ("ENUM declaration at %C has no ENUMERATORS");
- error_flag = 1;
- }
+ gfc_error ("ENUM declaration at %C has no ENUMERATORS");
accept_statement (st);
break;
diff --git a/gcc/genemit.c b/gcc/genemit.c
index 7ac3c91..1a65025 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -1,6 +1,6 @@
/* Generate code from machine description to emit insns as rtl.
Copyright (C) 1987, 1988, 1991, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
- 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -520,12 +520,13 @@ gen_expand (rtx expand)
(unless we aren't going to use them at all). */
if (XVEC (expand, 1) != 0)
{
- for (i = 0; i < operands; i++)
- printf (" operand%d = operands[%d];\n", i, i);
- for (; i <= max_dup_opno; i++)
- printf (" operand%d = operands[%d];\n", i, i);
- for (; i <= max_scratch_opno; i++)
- printf (" operand%d = operands[%d];\n", i, i);
+ for (i = 0;
+ i < MAX (operands, MAX (max_scratch_opno, max_dup_opno) + 1);
+ i++)
+ {
+ printf (" operand%d = operands[%d];\n", i, i);
+ printf (" (void) operand%d;\n", i);
+ }
}
printf (" }\n");
}
@@ -647,7 +648,10 @@ gen_split (rtx split)
/* Output code to copy the arguments back out of `operands' */
for (i = 0; i < operands; i++)
- printf (" operand%d = operands[%d];\n", i, i);
+ {
+ printf (" operand%d = operands[%d];\n", i, i);
+ printf (" (void) operand%d;\n", i);
+ }
/* Output code to construct the rtl for the instruction bodies.
Use emit_insn to add them to the sequence being accumulated.
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 3fefe43..f1a6080 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-07 Jakub Jelinek <jakub@redhat.com>
+
+ * exception.cc (_Jv_Throw): Avoid set but not used warning.
+ * include/java-assert.h (JvAssertMessage, JvAssert): Use argument in
+ sizeof to avoid set but not used warnings.
+
2010-01-20 Joern Rennecke <amylaar@spamcop.net>
* lang.c (java_post_options): Constify variable "dot".
diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c
index 099b9e0..a4f59f9 100644
--- a/gcc/java/builtins.c
+++ b/gcc/java/builtins.c
@@ -1,5 +1,5 @@
/* Built-in and inline functions for gcj
- Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2009
+ Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
@@ -323,6 +323,7 @@ compareAndSwapInt_builtin (tree method_return_type ATTRIBUTE_UNUSED,
{
tree addr, stmt;
UNMARSHAL5 (orig_call);
+ (void) value_type; /* Avoid set but not used warning. */
addr = build_addr_sum (int_type_node, obj_arg, offset_arg);
stmt = build_call_expr (built_in_decls[BUILT_IN_BOOL_COMPARE_AND_SWAP_4],
@@ -347,6 +348,7 @@ compareAndSwapLong_builtin (tree method_return_type ATTRIBUTE_UNUSED,
{
tree addr, stmt;
UNMARSHAL5 (orig_call);
+ (void) value_type; /* Avoid set but not used warning. */
addr = build_addr_sum (long_type_node, obj_arg, offset_arg);
stmt = build_call_expr (built_in_decls[BUILT_IN_BOOL_COMPARE_AND_SWAP_8],
@@ -410,7 +412,8 @@ getVolatile_builtin (tree method_return_type ATTRIBUTE_UNUSED,
{
tree addr, stmt, modify_stmt, tmp;
UNMARSHAL3 (orig_call);
-
+ (void) this_arg; /* Avoid set but not used warning. */
+
addr = build_addr_sum (method_return_type, obj_arg, offset_arg);
addr
= fold_convert (build_pointer_type (build_type_variant
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 3c0e2ca..a6a3f39 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -1,6 +1,6 @@
/* Process expressions for the GNU compiler for the Java(TM) language.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -3329,6 +3329,7 @@ process_jvm_instruction (int PC, const unsigned char* byte_ops,
{ \
int saw_index = 0; \
int index = OPERAND_VALUE; \
+ (void) saw_index; /* Avoid set but not used warning. */ \
build_java_ret \
(find_local_variable (index, return_address_type_node, oldpc)); \
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5c31381..b7fb0c5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2010-04-07 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/builtin-choose-expr.c: Avoid set but not used warnings.
+ * gcc.dg/trunc-1.c: Likewise.
+ * gcc.dg/vla-9.c: Likewise.
+ * gcc.dg/dfp/composite-type.c: Likewise.
+
2010-04-07 Iain Sandoe <iains@gcc.gnu.org>
PR objc/35996
diff --git a/gcc/testsuite/gcc.dg/builtin-choose-expr.c b/gcc/testsuite/gcc.dg/builtin-choose-expr.c
index 045dc6c..ceac605 100644
--- a/gcc/testsuite/gcc.dg/builtin-choose-expr.c
+++ b/gcc/testsuite/gcc.dg/builtin-choose-expr.c
@@ -29,6 +29,8 @@
t1 = t1b; \
t2 = t2a; \
t2 = t2b; \
+ (void) t1; \
+ (void) t2; \
} while (0)
diff --git a/gcc/testsuite/gcc.dg/dfp/composite-type.c b/gcc/testsuite/gcc.dg/dfp/composite-type.c
index 508ebbd..69ecb14 100644
--- a/gcc/testsuite/gcc.dg/dfp/composite-type.c
+++ b/gcc/testsuite/gcc.dg/dfp/composite-type.c
@@ -30,18 +30,19 @@ do \
d##TYPE = f2_##TYPE(h1_##TYPE); \
d##TYPE = f2_##TYPE(h2_##TYPE); \
d##TYPE = f2_##TYPE(h3_##TYPE); \
+ (void) d##TYPE; \
} while(0)
DECIMAL_COMPOSITE_DECL(32); /* { dg-error "incompatible types when assigning to type '\[^\n\]*' from type '\[^\n\]*'" } */
-/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 35 } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 36 } */
DECIMAL_COMPOSITE_DECL(64); /* { dg-error "incompatible types when assigning to type '\[^\n\]*' from type '\[^\n\]*'" } */
-/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 39 } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 40 } */
DECIMAL_COMPOSITE_DECL(128); /* { dg-error "incompatible types when assigning to type '\[^\n\]*' from type '\[^\n\]*'" } */
-/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 43 } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 44 } */
int main()
diff --git a/gcc/testsuite/gcc.dg/trunc-1.c b/gcc/testsuite/gcc.dg/trunc-1.c
index 0d6a48b..a78cceb 100644
--- a/gcc/testsuite/gcc.dg/trunc-1.c
+++ b/gcc/testsuite/gcc.dg/trunc-1.c
@@ -11,5 +11,5 @@ main (void)
len = ~(sizeof (size_t) - 1); /* { dg-bogus "truncated" "bogus truncation warning" } */
- return 0;
+ return len - len;
}
diff --git a/gcc/testsuite/gcc.dg/vla-9.c b/gcc/testsuite/gcc.dg/vla-9.c
index 0b623b3..506a1a2 100644
--- a/gcc/testsuite/gcc.dg/vla-9.c
+++ b/gcc/testsuite/gcc.dg/vla-9.c
@@ -6,4 +6,5 @@ void f(__SIZE_TYPE__ d)
{
typedef int t[d];
t *g = (__typeof (g)) d;
+ (void) g;
}
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 6cd47e1..7bb5088 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -252,17 +252,17 @@ typedef struct immediate_use_iterator_d
/* Use this iterator when simply looking at stmts. Adding, deleting or
modifying stmts will cause this iterator to malfunction. */
-#define FOR_EACH_IMM_USE_FAST(DEST, ITER, SSAVAR) \
+#define FOR_EACH_IMM_USE_FAST(DEST, ITER, SSAVAR) \
for ((DEST) = first_readonly_imm_use (&(ITER), (SSAVAR)); \
!end_readonly_imm_use_p (&(ITER)); \
- (DEST) = next_readonly_imm_use (&(ITER)))
+ (void) ((DEST) = next_readonly_imm_use (&(ITER))))
/* Use this iterator to visit each stmt which has a use of SSAVAR. */
#define FOR_EACH_IMM_USE_STMT(STMT, ITER, SSAVAR) \
for ((STMT) = first_imm_use_stmt (&(ITER), (SSAVAR)); \
!end_imm_use_stmt_p (&(ITER)); \
- (STMT) = next_imm_use_stmt (&(ITER)))
+ (void) ((STMT) = next_imm_use_stmt (&(ITER))))
/* Use this to terminate the FOR_EACH_IMM_USE_STMT loop early. Failure to
do so will result in leaving a iterator marker node in the immediate
@@ -290,7 +290,7 @@ typedef struct immediate_use_iterator_d
#define FOR_EACH_IMM_USE_ON_STMT(DEST, ITER) \
for ((DEST) = first_imm_use_on_stmt (&(ITER)); \
!end_imm_use_on_stmt_p (&(ITER)); \
- (DEST) = next_imm_use_on_stmt (&(ITER)))
+ (void) ((DEST) = next_imm_use_on_stmt (&(ITER))))
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index ee70583..227b06f 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -452,8 +452,9 @@ do { \
y_ = VEC_index (int, (GRAPH)->edge_list, x_); \
if (y_ != (NODE)) \
continue; \
- (VAR) = VEC_index (int, (GRAPH)->edge_list, x_ + 1); \
- (LOCUS) = VEC_index (source_location, (GRAPH)->edge_locus, x_ / 2); \
+ (void) ((VAR) = VEC_index (int, (GRAPH)->edge_list, x_ + 1)); \
+ (void) ((LOCUS) = VEC_index (source_location, \
+ (GRAPH)->edge_locus, x_ / 2)); \
CODE; \
} \
} while (0)
@@ -472,8 +473,9 @@ do { \
y_ = VEC_index (int, (GRAPH)->edge_list, x_ + 1); \
if (y_ != (NODE)) \
continue; \
- (VAR) = VEC_index (int, (GRAPH)->edge_list, x_); \
- (LOCUS) = VEC_index (source_location, (GRAPH)->edge_locus, x_ / 2); \
+ (void) ((VAR) = VEC_index (int, (GRAPH)->edge_list, x_)); \
+ (void) ((LOCUS) = VEC_index (source_location, \
+ (GRAPH)->edge_locus, x_ / 2)); \
CODE; \
} \
} while (0)
diff --git a/gcc/tree-ssa-operands.h b/gcc/tree-ssa-operands.h
index a435fab..13d29c3 100644
--- a/gcc/tree-ssa-operands.h
+++ b/gcc/tree-ssa-operands.h
@@ -1,5 +1,6 @@
/* SSA operand management for trees.
- Copyright (C) 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005, 2006, 2007, 2008, 2010
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -160,7 +161,7 @@ typedef struct ssa_operand_iterator_d
#define FOR_EACH_SSA_TREE_OPERAND(TREEVAR, STMT, ITER, FLAGS) \
for (TREEVAR = op_iter_init_tree (&(ITER), STMT, FLAGS); \
!op_iter_done (&(ITER)); \
- TREEVAR = op_iter_next_tree (&(ITER)))
+ (void) (TREEVAR = op_iter_next_tree (&(ITER))))
/* This macro executes a loop over the operands of STMT specified in FLAG,
returning each operand as a 'use_operand_p' in the variable USEVAR.
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 2331e7b..35ce4cc 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -4498,7 +4498,6 @@ my_rev_post_order_compute (int *post_order, bool include_entry_exit)
int sp;
int post_order_num = 0;
sbitmap visited;
- int count;
if (include_entry_exit)
post_order[post_order_num++] = EXIT_BLOCK;
@@ -4553,12 +4552,7 @@ my_rev_post_order_compute (int *post_order, bool include_entry_exit)
}
if (include_entry_exit)
- {
- post_order[post_order_num++] = ENTRY_BLOCK;
- count = post_order_num;
- }
- else
- count = post_order_num + 2;
+ post_order[post_order_num++] = ENTRY_BLOCK;
free (stack);
sbitmap_free (visited);
diff --git a/gcc/tree.c b/gcc/tree.c
index 30bc5be..5da8206 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -3652,9 +3652,9 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
side_effects = 1; \
if (!TREE_READONLY (arg##N) \
&& !CONSTANT_CLASS_P (arg##N)) \
- read_only = 0; \
+ (void) (read_only = 0); \
if (!TREE_CONSTANT (arg##N)) \
- constant = 0; \
+ (void) (constant = 0); \
} \
} while (0)
diff --git a/gcc/tree.h b/gcc/tree.h
index c5c7b01..4a0fb5e 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1507,9 +1507,9 @@ struct GTY(()) tree_vec {
#define FOR_EACH_CONSTRUCTOR_ELT(V, IX, INDEX, VAL) \
for (IX = 0; (IX >= VEC_length (constructor_elt, V)) \
? false \
- : ((VAL = VEC_index (constructor_elt, V, IX)->value), \
+ : (((void) (VAL = VEC_index (constructor_elt, V, IX)->value)), \
(INDEX = VEC_index (constructor_elt, V, IX)->index), \
- true); \
+ true); \
(IX)++)
/* Append a new constructor element to V, with the specified INDEX and VAL. */