Patchwork [GOOGLE] Back port discriminator patches to gcc-4_8

login
register
mail settings
Submitter Cary Coutant
Date May 20, 2013, 10:53 p.m.
Message ID <CAHACq4ooXucp8eDq=oz80CNh+UfguuYZOKGr3=mNtBaO=4VgSQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/245129/
State New
Headers show

Comments

Cary Coutant - May 20, 2013, 10:53 p.m.
>> I've updated the patch. Bootstrapped and passed all regression test.
>>
>> OK for google-4_8?


+  /* If LOC describes a location with a discriminator, extract the
+     discriminator and map it to the real location.  */
+  if (min_discriminator_location != UNKNOWN_LOCATION
+      && loc >= min_discriminator_location
+      && loc < min_discriminator_location + next_discriminator_location)

The last test should be "loc < next_discriminator_location".

+bool
+has_discriminator (location_t locus)
+{
+  locus = LOCATION_LOCUS (locus);
+  return (min_discriminator_location != UNKNOWN_LOCATION
+  && locus >= min_discriminator_location
+  && locus < min_discriminator_location + next_discriminator_location);

Likewise.

+  ret = block ?
+      COMBINE_LOCATION_DATA (line_table, next_discriminator_location, block)
+      : LOCATION_LOCUS (next_discriminator_location);
+  next_discriminator_location++;
+  return ret;

LOCATION_LOCUS is unnecessary here (next_discriminator_location is
never an ad hoc location). This could be:

  ret = next_discriminator_location++;
  if (block != NULL)
    ret = COMBINE_LOCATION_DATA (line_table,
next_discriminator_location, block);
  return ret;

-cary

Patch

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in (revision 199127)
+++ gcc/Makefile.in (working copy)
@@ -1470,7 +1470,7 @@  OBJS-libcommon = diagnostic.o pretty-print.o intl.
 # compiler and containing target-dependent code.
 OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \
  opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \
- hash-table.o file-find.o
+ hash-table.o file-find.o vec.o

This already has vec.o on the previous line. OBJS-libcommon is the one
that's missing vec.o.