This is the mail archive of the gcc-bugs@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]

[Bug c/15114] -funit-at-a-time causes compilation of functions with variable length arrays to fail


------- Additional Comments From rsmith at xs4all dot nl  2004-04-24 15:31 -------
Subject: Re:  -funit-at-a-time causes compilation of functions with variable length arrays to fail

On Sat, Apr 24, 2004 at 01:50:34PM -0000, pinskia at gcc dot gnu dot org wrote:
> 
> I can confirm this but I do not know if this valid GNU C at all.
> 

Variable Length Arrays are a C99 feature. The code in question compiled
without warnings with 3.3.3. 

It also matches one of the examples in the GCC info files. :-)

OTOH, the status page [http://gcc.gnu.org/gcc-3.4/c99status.html] lists
VLA's as "broken".

But as far as I can tell the compiled code works fine, just like it did
when compiled with 3.3.3. 

In my laymans eyes it looks like some kind of parser error, because it
complains about the function 'mat_unity' and then references the
definitions of other functions:

| matrix.c: In function `mat_unity':
The function mat_unity starts at line 89, and stops at line 104.

|matrix.c:106: error: prior parameter's size depends on 'n'
|matrix.c:106: error: prior parameter's size depends on 'n'
|matrix.c:106: error: prior parameter's size depends on 'n'
|matrix.c:106: error: prior parameter's size depends on 'n'
|...

Line 106 is the start of the function mat_cpy.

Just guessing, but maybe the parser forgets to close the function context
when -funit-at-a-time is active?

I'm using -fno-unit-at-a-time as a workaround, but "this scheme may not be
supported by future releases of GCC" according to
[http://gcc.gnu.org/gcc-3.4/changes.html].

Roland


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15114


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