[Committed] Fix declared inline after being called warning

Message ID 50697273.7070306@mentor.com
State New
Headers show

Commit Message

Tom de Vries Oct. 1, 2012, 10:37 a.m.

I've committed to branch 4.7 as obvious attached patch that fixes a compiler
warning 'declared inline after being called'.

I ran into this warning when building the 4.7 branch with a gcc 4.3 compiler:
var-tracking.c:558: warning: 'set_dv_changed' declared inline after being called
var-tracking.c:558: warning: previous declaration of 'set_dv_changed' was here

Other instances of this problem are:
- http://gcc.gnu.org/ml/gcc-patches/2011-12/msg00256.html
- http://gcc.gnu.org/ml/gcc-patches/2011-04/msg01426.html

I've fixed this in the 4.7 branch. The problem is not present in the 4.6 branch,
and with trunk the warning doesn't trigger, I suppose because we're using g++ now.

Build on i686-pc-linux-gnu.

- Tom

2012-10-01  Tom de Vries  <tom@codesourcery.com>

	* var-tracking.c (set_dv_changed): Add an 'inline' function specifier to
	the prototype.


Index: gcc/var-tracking.c
--- gcc/var-tracking.c (revision 191792)
+++ gcc/var-tracking.c (working copy)
@@ -570,7 +570,7 @@  static void dump_vars (htab_t);
 static void dump_dataflow_set (dataflow_set *);
 static void dump_dataflow_sets (void);
-static void set_dv_changed (decl_or_value, bool);
+static inline void set_dv_changed (decl_or_value, bool);
 static void variable_was_changed (variable, dataflow_set *);
 static void **set_slot_part (dataflow_set *, rtx, void **,
 			     decl_or_value, HOST_WIDE_INT,