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]

Re: [PATCH] Provide debug info for SRA optimized variables (PR debug/43983)


Hi!

On Wed, May 12, 2010 at 09:32:30PM +0200, Manuel López-Ibáñez wrote:
> On 12 May 2010 20:46, Jason Merrill <jason@redhat.com> wrote:
> > So, in this patch you're changing the var_loc_note field to be either a
> > varloc note or a piece EXPR_LIST that does not appear anywhere else in the
> > compiler, correct? ?Please document this new data structure.
> 
> I am probably suggesting something stupid given that I am quite
> ignoring about how the debug information is computed and stored but,
> couldn't reuse this to emit better diagnostics from the middle-end?

You can use DECL_DEBUG_EXPR_IS_FROM/DECL_DEBUG_EXPR for diagnostics
purposes, but AFAIK that is already done, e.g. in %D handling
in default_tree_printer.
I don't see how is that related to var-tracking/dwarf2out changes
in the patch - that stuff is certainly not useful for diagnostics.

BTW, for:

struct S { int i, j; };

int foo (int l)
{
  struct S s;
  s.j = l - 22;
  return s.i + s.j;
}

warn_uninit doesn't see the s$i variable from which it could print something
better than {anonymous}, while for say:

struct S { int i, j; };

int foo (int l)
{
  struct S s;
  if (l > 126)
    {
      s.j = l - 22;
      return s.i + s.j;
    }
  s.i = 12;
  s.j = l + 40;
  return s.i + s.j;
}

it does.  Perhaps SRA should instantiate even the uninitialized fields?

	Jakub


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