This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] tree-ssa.c: Fix PR tree-optimization/17506.
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Kazu Hirata <kazu at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, nathan at codesourcery dot com, joern dot rennecke at st dot com, reichelt at igpm dot rwth-aachen dot de
- Date: Sun, 27 Aug 2006 23:54:45 -0700
- Subject: Re: [patch] tree-ssa.c: Fix PR tree-optimization/17506.
- References: <200608280520.k7S5KpJ8027583@sparrowhawk.codesourcery.com>
On Sun, 2006-08-27 at 22:20 -0700, Kazu Hirata wrote:
> + fun_locus = &DECL_SOURCE_LOCATION(cfun->decl);
> + if (locus->file != fun_locus->file
> + || locus->line < fun_locus->line
> + || locus->line > cfun->function_end_locus.line)
> + inform ("%J%qD was declared here", var, var);
I don't think this will work with nested functions, take the following
example:
void baz (void);
void
bar (void)
{
int foo (int i)
{
if (i) /* { dg-warning "used uninitialized in this function" } */
return 1;
return 0;
}
int j; /* { dg-error "note: 'j' was declared here" } */
for (; foo (j); ++j)
baz ();
}
----
The if expression above will be false for this case.
Thanks,
Andrew Pinski