public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Fix violation of self-assignment check in GCC source [3/4]
@ 2010-07-22  1:34 Le-Chun Wu
  2010-07-22  8:29 ` Richard Guenther
  0 siblings, 1 reply; 2+ messages in thread
From: Le-Chun Wu @ 2010-07-22  1:34 UTC (permalink / raw)
  To: geoffk, GCC Patches

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Fix violation of self-assignment check in GCC source  [3/4]
  2010-07-22  1:34 [patch] Fix violation of self-assignment check in GCC source [3/4] Le-Chun Wu
@ 2010-07-22  8:29 ` Richard Guenther
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Guenther @ 2010-07-22  8:29 UTC (permalink / raw)
  To: Le-Chun Wu; +Cc: geoffk, GCC Patches

On Thu, Jul 22, 2010 at 3:34 AM, Le-Chun Wu <lcwu@google.com> wrote:
> 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?

Ok.

Thanks,
Richard.

> 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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-22  8:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-22  1:34 [patch] Fix violation of self-assignment check in GCC source [3/4] Le-Chun Wu
2010-07-22  8:29 ` Richard Guenther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).