public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108375] New: [10/11/12/13 Regression] Some variably modified types not detected as such
@ 2023-01-11 18:44 jsm28 at gcc dot gnu.org
  2023-01-11 19:36 ` [Bug c/108375] " pinskia at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2023-01-11 18:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108375
           Summary: [10/11/12/13 Regression] Some variably modified types
                    not detected as such
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jsm28 at gcc dot gnu.org
  Target Milestone: ---

variably_modified_type_p fails to detect an array type as variably modified if
the array and its element type are of constant size but the element type is
variably modified. For example, the following code should be diagnosed as
invalid, but is not (similar rejects-valid or wrong-code examples could no
doubt be constructed as well).

void
f (int a)
{
  typedef int A[a];
  goto x;
  A *p[2];
  x : ;
}

This is a regression in 4.2 and later relative to older versions, I think
introduced by g:2e3b8fe7b5405a94d86bfa323c0e80e83c58d784 .

commit 2e3b8fe7b5405a94d86bfa323c0e80e83c58d784
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Wed May 17 13:11:09 2006 +0000

    tree.c (variably_modified_type_p): Return true if the element type is
variably modified without recursing.

            * tree.c (variably_modified_type_p) <ARRAY_TYPE>: Return true
            if the element type is variably modified without recursing.

    From-SVN: r113858

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

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

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-11 18:44 [Bug c/108375] New: [10/11/12/13 Regression] Some variably modified types not detected as such jsm28 at gcc dot gnu.org
2023-01-11 19:36 ` [Bug c/108375] " pinskia at gcc dot gnu.org
2023-01-11 19:38 ` pinskia at gcc dot gnu.org
2023-01-11 19:40 ` pinskia at gcc dot gnu.org
2023-01-13 11:31 ` ebotcazou at gcc dot gnu.org
2023-02-13 13:57 ` muecker at gwdg dot de
2023-02-14  8:34 ` muecker at gwdg dot de
2023-02-15 23:04 ` muecker at gwdg dot de
2023-02-17 20:31 ` muecker at gwdg dot de
2023-02-18  9:39 ` cvs-commit at gcc dot gnu.org
2023-02-21 13:13 ` [Bug c/108375] [10/11/12 " rguenth at gcc dot gnu.org
2023-02-21 13:36 ` muecker at gwdg dot de
2023-07-07 10:44 ` [Bug c/108375] [11/12 " 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).