This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C identifier lookup speedups, 2/2
Zack Weinberg <zack at codesourcery dot com> writes:
> David Edelsohn <dje at watson dot ibm dot com> writes:
>
> > With your recent patch,
> >
> > gcc.c-torture/execute/scope-2.c
> >
> > now fails with all options on AIX.
> >
> > ld: 0711-317 ERROR: Undefined symbol: v
> >
> > I do not know if any of the follow-up patches fixes it.
>
> This program is ill-formed - the static decl 'v' at file scope refers
> to the same object as the extern decl 'v' at block scope, which
> induces undefined behavior. Having said that, I do not know why it
> compiles and executes successfully on Linux but not on AIX.
This probably has something to do with the way AIX treats external
vs. internal references.
> My inclination is to "fix" this by causing the compiler to reject the
> program, and move the test case to c-torture/noncompile.
I agree.
--
- Geoffrey Keating <geoffk at geoffk dot org>