public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Bill Maddox" <maddox@google.com>
To: "Rafael Espindola" <espindola@google.com>
Cc: "Richard Guenther" <richard.guenther@gmail.com>,
	        gcc-patches <gcc-patches@gcc.gnu.org>,
	        "Diego Novillo" <dnovillo@google.com>
Subject: Re: [lto][patch] remove local variables from types (after gimplification)
Date: Wed, 25 Jun 2008 21:13:00 -0000	[thread overview]
Message-ID: <8a0e66f0806251408q61a7031fw6b568353bd63ce2@mail.gmail.com> (raw)
In-Reply-To: <38a0d8450806241326w5f03bf3bo4c6e16eff91f675f@mail.gmail.com>

On Tue, Jun 24, 2008 at 1:26 PM, Rafael Espindola <espindola@google.com> wrote:
> 2008-06-24  Rafael Espindola  <espindola@google.com>
>
>        * calls.c (must_pass_in_stack_var_size_or_pad): Don't check if
>        TYPE_SIZE is NULL.
>        * expr.c (store_field): Don't check if TYPE_SIZE is NULL.
>        * tree.c (reset_type_lang_specific): Set both TYPE_SIZE_UNIT
>        and TYPE_SIZE or none of them. Don't set TYPE_MAX_VALUE to
>        NULL. call set_min_and_max_values_for_integral_type.

I updated to top of lto branch, and noticed the following test was
first to fail:

   FAIL: gcc.c-torture/compile/20020210-1.c  -O2 -flto  (internal
compiler error)

In this case, the failure is due to an attempt to stream out a SAVE_EXPR node.
I have a development sandbox that includes the patch, but is apparently choosing
a different order in which to stream out the nodes, and which exhibits a much
more interesting failure, encountering a local variable in a type.
The program is
trivial:

  void f(int a, struct {int b[a];} c) {}

The problem is that the size of the *structure* type is variable, due
to the embedded
VLA.  While this program is not valid C99, it is apparently permitted
as a GNU extension,
and similar constructs arise in other languages, e.g. Ada.  Clearly we
are not catching
all of the occurrences of variables within types.  This may just be an
oversight, but I'd
like to know if it is generally the case that the middle-end/back-end
does not not need
this information, or whether the justification for erasing the size of
array types is specific
to the case of arrays.

--Bill

  parent reply	other threads:[~2008-06-25 21:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23 14:48 Rafael Espindola
2008-06-23 15:27 ` Diego Novillo
2008-06-24  9:32 ` Richard Guenther
2008-06-24 13:18   ` Rafael Espindola
2008-06-24 13:44     ` Richard Guenther
2008-06-24 20:38       ` Rafael Espindola
2008-06-24 20:44         ` Richard Guenther
2008-06-24 20:49           ` Rafael Espindola
2008-06-24 20:56             ` Richard Guenther
2008-06-25 21:13         ` Bill Maddox [this message]
2008-06-25 21:19           ` Rafael Espindola
2008-06-25 21:39             ` Richard Guenther
2008-06-25 23:33             ` Bill Maddox
2008-06-26  9:53               ` Richard Guenther
2008-06-26 14:53                 ` Rafael Espindola
2008-06-26 15:13                   ` Richard Guenther
2008-06-26 16:14               ` Rafael Espindola
2008-06-26 17:48                 ` Diego Novillo
2008-06-26 18:36                   ` Rafael Espindola
2008-06-26 14:26             ` Rafael Espindola
2008-06-26 18:14               ` Rafael Espindola
2008-07-02 20:58 ` Bill Maddox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8a0e66f0806251408q61a7031fw6b568353bd63ce2@mail.gmail.com \
    --to=maddox@google.com \
    --cc=dnovillo@google.com \
    --cc=espindola@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).