public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/97986] New: ICE in force_constant_size when applying va_arg to VLA type
@ 2020-11-25 14:48 pascal_cuoq at hotmail dot com
  2020-11-25 21:33 ` [Bug c/97986] " joseph at codesourcery dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: pascal_cuoq at hotmail dot com @ 2020-11-25 14:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97986

            Bug ID: 97986
           Summary: ICE in force_constant_size when applying va_arg to VLA
                    type
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pascal_cuoq at hotmail dot com
  Target Milestone: ---

This bug seems most similar to (but still different from)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59711 (in which a comment says
that it appears to have been fixed in GCC 6).

In GCC 10.2 and some earlier versions, compiling the following program
(Compiler Explorer link: https://gcc.godbolt.org/z/11ob5j ):

#include <stdarg.h>

int sum(int n, ...)
{
    va_list ap;
    va_start(ap, n);
    int *input = va_arg(ap, int[n]);
    int rc = 0;
    for (int i = 0; i < n; i++)
        rc += input[i];
    return rc;
}

Produces the following error message:

In file included from <source>:1:
<source>: In function 'sum':
<source>:7:29: internal compiler error: in force_constant_size, at
gimplify.c:733
    7 |     int *input = va_arg(ap, int[n]);
      |                             ^~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-07-07 10:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 14:48 [Bug c/97986] New: ICE in force_constant_size when applying va_arg to VLA type pascal_cuoq at hotmail dot com
2020-11-25 21:33 ` [Bug c/97986] " joseph at codesourcery dot com
2022-01-03 21:05 ` [Bug c/97986] [9/10/11/12 Regression] " pinskia at gcc dot gnu.org
2022-01-03 21:27 ` pinskia at gcc dot gnu.org
2022-01-17 15:05 ` rguenth at gcc dot gnu.org
2022-01-31 15:54 ` [Bug c/97986] [9/10/11/12 Regression] ICE in force_constant_size when applying va_arg to VLA type since r6-91-gf8e89441bc5518f4 marxin at gcc dot gnu.org
2022-05-27  9:43 ` [Bug c/97986] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:42 ` jakub at gcc dot gnu.org
2023-07-07 10:38 ` [Bug c/97986] [11/12/13/14 " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).