public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: Richard Guenther <richard.guenther@gmail.com>
Cc: gcc-patches@gcc.gnu.org, jason@redhat.com, tromey@redhat.com,
	       gdr@integrable-solutions.net, joseph@codesourcery.com,
	burnus@net-b.de,        charlet@act-europe.fr
Subject: Re: [PATCH 3/6] Emit macro expansion related diagnostics
Date: Mon, 17 Oct 2011 12:22:00 -0000	[thread overview]
Message-ID: <m3ty77x2ex.fsf@redhat.com> (raw)
In-Reply-To: <CAFiYyc2HtvzNjQXGmhYterKGFSFscj8oMWgzxvtpNOtQt2wDqw@mail.gmail.com>	(Richard Guenther's message of "Mon, 17 Oct 2011 12:42:29 +0200")

Richard Guenther <richard.guenther@gmail.com> writes:

> This broke bootstrap on x86_64-linux.
>
> /space/rguenther/src/svn/trunk/libcpp/line-map.c: In function
> 'source_location linemap_macro_map_loc_to_exp_point(const line_map*,
> source_location)':
> /space/rguenther/src/svn/trunk/libcpp/line-map.c:628:12: error:
> variable 'token_no' set but not used [-Werror=unused-but-set-variable]
> cc1plus: all warnings being treated as errors

Sigh.

I guess the reason why my testing hasn't caught this is that I am
bootstrapping with --enable-checking and so on my system ENABLE_CHECKING
is defined and my GCC_VERSION >= 2007.

I am bootstrapping and testing the obvious patch below with
--disable-bootstrap and I am planning to check it in if it passes, under
the obvious rule.

Sorry for the inconvenience.

commit e957242a9a8ec8f297e05ca0dae1d63bf543fad8
Author: Dodji Seketeli <dodji@redhat.com>
Date:   Mon Oct 17 13:33:41 2011 +0200

    Fix bootstrapping with --disable-checking
    
    libcpp/ChangeLog
    
    	* line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
    	variable without using it if ENABLE_CHECKING is not defined.

diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 87b8bfe..a1d0fbb 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -625,14 +625,12 @@ source_location
 linemap_macro_map_loc_to_exp_point (const struct line_map *map,
 				    source_location location)
 {
-  unsigned token_no;
-
   linemap_assert (linemap_macro_expansion_map_p (map)
 		  && location >= MAP_START_LOCATION (map));
 
   /* Make sure LOCATION is correct.  */
-  token_no = location - MAP_START_LOCATION (map);
-  linemap_assert (token_no <  MACRO_MAP_NUM_MACRO_TOKENS (map));
+  linemap_assert ((location - MAP_START_LOCATION (map))
+		  <  MACRO_MAP_NUM_MACRO_TOKENS (map));
 
   return MACRO_MAP_EXPANSION_POINT_LOCATION (map);
 }
-- 
		Dodji

  reply	other threads:[~2011-10-17 11:51 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-17  9:58 [PATCH 0/6] Tracking locations of tokens resulting from macro expansion Dodji Seketeli
2011-10-17  9:58 ` [PATCH 3/6] Emit macro expansion related diagnostics Dodji Seketeli
2011-10-17 10:56   ` Richard Guenther
2011-10-17 12:22     ` Dodji Seketeli [this message]
2011-10-17 14:11       ` Dodji Seketeli
2011-10-17 17:41         ` H.J. Lu
2011-10-18  0:29           ` Dodji Seketeli
2011-10-18  6:07             ` Jason Merrill
2011-10-18  9:22               ` Dodji Seketeli
2011-10-17 10:08 ` [PATCH 4/6] Support -fdebug-cpp option Dodji Seketeli
2011-10-17 10:19 ` [PATCH 6/6] Reduce memory waste due to non-power-of-2 allocs Dodji Seketeli
2011-10-17 10:22 ` [PATCH 5/6] Add line map statistics to -fmem-report output Dodji Seketeli
2011-10-17 10:25 ` [PATCH 1/6] Linemap infrastructure for virtual locations Dodji Seketeli
2011-10-17 19:53   ` Gerald Pfeifer
2011-10-17 20:44     ` Dodji Seketeli
2011-10-18  7:24       ` Gerald Pfeifer
2011-10-18  9:44         ` Dodji Seketeli
2011-10-17 10:26 ` [PATCH 2/6] Generate virtual locations for tokens Dodji Seketeli
2011-10-19 14:48   ` Ulrich Weigand
2011-10-19 17:11     ` Dodji Seketeli
2011-10-19 20:42     ` Dodji Seketeli
  -- strict thread matches above, loose matches on Subject: below --
2011-10-18 15:25 [PATCH 3/6] Emit macro expansion related diagnostics David Edelsohn
2011-10-18 15:30 ` Joseph S. Myers
2011-10-18 15:37   ` Gabriel Dos Reis
2011-10-18 15:34 ` Jakub Jelinek
2011-10-18 16:56 ` Dodji Seketeli
2011-10-18 18:16   ` Dodji Seketeli
2010-12-10 11:27 [PATCH 0/6] Tracking locations of tokens resulting from macro expansion Dodji Seketeli
2010-12-10 11:27 ` [PATCH 3/6] Emit macro expansion related diagnostics Dodji Seketeli
2010-12-13 15:25   ` Paolo Bonzini
2010-12-13 15:38     ` Paolo Bonzini
2010-12-13 16:30     ` Manuel López-Ibáñez
2010-12-14  7:24     ` Dodji Seketeli
2010-12-14  7:28       ` Gabriel Dos Reis
2010-12-14  8:40         ` Dodji Seketeli
2010-12-14  9:38           ` Gabriel Dos Reis
2010-12-14  9:42             ` Dodji Seketeli
2010-12-14  9:48               ` Gabriel Dos Reis
2010-12-14  7:28     ` Dodji Seketeli
2010-12-14  8:19       ` Gabriel Dos Reis
2010-12-14  8:31         ` Paolo Bonzini
2010-12-14  9:23           ` Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3ty77x2ex.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=burnus@net-b.de \
    --cc=charlet@act-europe.fr \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdr@integrable-solutions.net \
    --cc=jason@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=richard.guenther@gmail.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).