public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: David Edelsohn <dje.gcc@gmail.com>
Cc: Bernd Schmidt <bschmidt@redhat.com>, Jeffrey Law <law@redhat.com>,
	       GCC Patches <gcc-patches@gcc.gnu.org>,
	       Richard Biener <richard.guenther@gmail.com>,
	       Dodji Seketeli <dodji@redhat.com>
Subject: Re: [PATCH] Fix uninitialized src_range within c_expr (Re: libcpp/C FE source range patch committed (r230331))
Date: Sat, 21 Nov 2015 20:07:00 -0000	[thread overview]
Message-ID: <1448136002.19594.162.camel@surprise> (raw)
In-Reply-To: <CAGWvnyn5kCECW+w-3B2k8KoTpK54M6Eh9dVKo2jMKRnCs2bGgg@mail.gmail.com>

On Sat, 2015-11-21 at 13:54 -0500, David Edelsohn wrote:
> On Tue, Nov 17, 2015 at 3:12 PM, David Malcolm <dmalcolm@redhat.com> wrote:
> > On Tue, 2015-11-17 at 16:24 +0100, Bernd Schmidt wrote:
> >> On 11/17/2015 04:13 PM, David Malcolm wrote:
> >> > On Mon, 2015-11-16 at 22:34 +0100, Bernd Schmidt wrote:
> >> >>
> >> >> Should c_expr perhaps acquire a constructor so that this problem is
> >> >> avoided in the future? The whole thing seems somewhat error-prone.
> >> >
> >> > I agree that it's error prone, and the ctor approach is what I've been
> >> > trying for the C++ FE [1] but I suspect that touching that in the C FE
> >> > would be a much more invasive patch (unless we simply give it a default
> >> > ctor that makes the src_range be a pair of UNKNOWN_LOCATIONS?).
> >>
> >> The UNKNOWN_LOCATIONS pair would have been my approach, yes.
> >>
> >> > This case gains a pair of locals: start_loc and end_loc (so that we can
> >> > track the spelling range whilst retaining the "loc" used for the caret),
> >> > and I preferred to confine their scope to within the case, hence the
> >> > extra braced block.  Omitting the braced block leads to:
> >> > ../../src/gcc/c/c-parser.c:7494:7: error: jump to case label [-fpermissive]
> >> >    case RID_OFFSETOF:
> >> >         ^
> >> > ../../src/gcc/c/c-parser.c:7472:17: error:   crosses initialization of ‘location_t end_loc’
> >> >        location_t end_loc = c_parser_peek_token (parser)->get_finish ();
> >> >                   ^
> >> > etc.
> >>
> >> Hmm, odd, I tried placing just the location_t start_loc line into the
> >> switch and that appeared to compile fine. But I guess this is not a huge
> >> problem.
> >> >
> >> > Is the combination of the 3 patches OK for trunk? (assuming
> >> > bootstrap&regrest; it's only the braced-init tweak that hasn't been).
> >>
> >> Yes.
> >
> > Thanks.  I've committed the 3 patches to trunk as r230497, which should
> > fix the worst of the regressions caused by r230331 seen on AIX.  I'll
> > continue to investigate as per the discussion above.
> 
> Hi, David
> 
> The new stret-1.m Objective C failure on AIX shows the same symptoms.
> Is there another fix needed for Objective C?
> 
> #1  0x10016794 in _Z14linemap_lookupP9line_mapsj (set=0x70000000, line=991)
>     at /nasfarm/edelsohn/src/src/libcpp/line-map.c:991
> 991       linemap_assert (line >= LINEMAPS_MACRO_LOWEST_LOCATION (set));

I believe this one is fixed by the patch I posted here:
 "[PATCH] Fix PR objc/68438 (uninitialized source ranges)"
   https://gcc.gnu.org/ml/gcc-patches/2015-11/msg02536.html

(it runs cleanly under valgrind on x86_64 with that patch applied)


  reply	other threads:[~2015-11-21 20:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-14 14:50 libcpp/C FE source range patch committed (r230331) David Edelsohn
2015-11-15  4:32 ` David Malcolm
2015-11-16 20:50   ` [PATCH] Fix uninitialized src_range within c_expr (Re: libcpp/C FE source range patch committed (r230331)) David Malcolm
2015-11-16 21:34     ` Bernd Schmidt
2015-11-17 15:13       ` David Malcolm
2015-11-17 15:24         ` Bernd Schmidt
2015-11-17 20:12           ` David Malcolm
2015-11-21 18:58             ` David Edelsohn
2015-11-21 20:07               ` David Malcolm [this message]
2015-11-21 22:03                 ` David Edelsohn
     [not found] ` <CANd1uZkKmxqX_6y0M6dxgfpdf83HuXX9+gRBiqzYECqon54NrQ@mail.gmail.com>
2015-11-24 11:27   ` Fwd: libcpp/C FE source range patch committed (r230331) Jay Foad
2015-11-24 11:37     ` Marek Polacek
2015-11-24 11:54       ` Jay Foad
2015-11-24 11:55         ` Marek Polacek

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=1448136002.19594.162.camel@surprise \
    --to=dmalcolm@redhat.com \
    --cc=bschmidt@redhat.com \
    --cc=dje.gcc@gmail.com \
    --cc=dodji@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=richard.guenther@gmail.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).