public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Richard Henderson <rth@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: PATCH: Gimplify VA_ARG_EXPR
Date: Wed, 09 Jun 2004 22:01:00 -0000	[thread overview]
Message-ID: <xypy8mwwjfa.fsf@miranda.boston.redhat.com> (raw)
In-Reply-To: <20040609200716.GA13131@redhat.com> (Richard Henderson's message of "Wed, 9 Jun 2004 13:07:16 -0700")

On Wed, 9 Jun 2004 13:07:16 -0700, Richard Henderson <rth@redhat.com> wrote:

> On Wed, Jun 09, 2004 at 01:05:34AM -0400, Jason Merrill wrote:
>> +   tree valist = TREE_OPERAND (*expr_p, 0);
> ...
>> +   valist = build_fold_indirect_ref (valist);
>
> The argument to va_arg_expr isn't a pointer.

If you're referring to the use in ix86_gimplify_va_arg, the expander does
the same thing.  On x86_64 the argument is too a pointer, generated in
stabilize_va_list.

>
>> +   addr = create_tmp_var (ptr_type_node, "addr");
>> +   DECL_POINTER_ALIAS_SET (addr) = get_varargs_alias_set ();
>
> Alias set on the decl and not the type?  Isn't this going to be
> (potentially) broken by gimplification?

The alias bit dates from before I gave up on getting the varargs alias set
to work right now.  I figured it was harmless and might as well leave it in.

>> +   tree t = convert (build_pointer_type (type), null_pointer_node);
>
> fold_convert.

OK, thanks.

>> +       /* Make it easier for the backends by protecting the valist argument
>> +          from multiple evaluations.  */
>> +       valist = stabilize_va_list (valist, 0);
>
> Seems like the min_value thing would be better here.

stabilize_va_list predates this patch.  I tried moving the min_lval bit
from std_gimplify_va_arg_expr to here, but it broke on x86_64 because
valist is an ADDR_EXPR.  I could poke at that some more if you think it's
warranted.

Jason

  reply	other threads:[~2004-06-09 20:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-09  7:21 Jason Merrill
2004-06-09 21:39 ` Richard Henderson
2004-06-09 22:01   ` Jason Merrill [this message]
2004-06-09 22:30     ` Richard Henderson
2004-06-10 17:54       ` followup " Jason Merrill
2004-06-14  5:51         ` Jason Merrill

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=xypy8mwwjfa.fsf@miranda.boston.redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rth@redhat.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).