This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Fix violation of self-assignment check in GCC source [3/4]


This patch fix the warning triggered by self-assignment check in
gcc/dbxout.c. Bootstrapped and tested on x86_64-gnu-linux. OK for
trunk?

Thanks,

Le-chun

2010-07-21  Le-Chun Wu  <lcwu@google.com>

       * dbxout.c (DEBUGGER_ARG_OFFSET): Change OFFSET to OFFSET+0 to avoid
       self-assign warning.


Index: gcc/dbxout.c
===================================================================
--- gcc/dbxout.c        (revision 162385)
+++ gcc/dbxout.c        (working copy)
@@ -289,9 +289,12 @@ static const char *base_input_file;
 #endif

 /* A C expression for the integer offset value of an argument (N_PSYM)
-   having address X (an RTX).  The nominal offset is OFFSET.  */
+   having address X (an RTX).  The nominal offset is OFFSET.
+   Note that we use OFFSET + 0 here to avoid the self-assign warning
+   when the macro is called in a context like
+   number = DEBUGGER_ARG_OFFSET(number, X)  */
 #ifndef DEBUGGER_ARG_OFFSET
-#define DEBUGGER_ARG_OFFSET(OFFSET, X) (OFFSET)
+#define DEBUGGER_ARG_OFFSET(OFFSET, X) (OFFSET + 0)
 #endif

 /* This obstack holds the stab string currently being constructed.  We


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]