public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Rafael Ávila de Espíndola" <rafael.espindola@gmail.com>
To: Jim Wilson <wilson@specifix.com>
Cc: gcc@gcc.gnu.org
Subject: Re: can DECL_RESULT be 0?
Date: Sun, 20 Nov 2005 19:58:00 -0000	[thread overview]
Message-ID: <200511201801.59206.rafael.espindola@gmail.com> (raw)
In-Reply-To: <437D2FC9.6090009@specifix.com>


[-- Attachment #1.1: Type: text/plain, Size: 217 bytes --]

On Thursday 17 November 2005 23:35, Jim Wilson wrote:
>
> I've checked in a patch to fix the comment typo.

Thanks,
What do you thing about adding an assert? Something similar to the attached 
patch.

Rafael

[-- Attachment #1.2: gcc-decl-result.patch --]
[-- Type: text/x-diff, Size: 737 bytes --]

Index: gcc/function.c
===================================================================
--- gcc/function.c	(revision 107249)
+++ gcc/function.c	(working copy)
@@ -1711,8 +1711,11 @@ aggregate_value_p (tree exp, tree fntype
 {
   int i, regno, nregs;
   rtx reg;
+  tree type;
 
-  tree type = (TYPE_P (exp)) ? exp : TREE_TYPE (exp);
+  gcc_assert (exp != NULL_TREE);
+
+  type = (TYPE_P (exp)) ? exp : TREE_TYPE (exp);
 
   if (fntype)
     switch (TREE_CODE (fntype))
@@ -3805,6 +3808,7 @@ allocate_struct_function (tree fndecl)
   cfun->decl = fndecl;
 
   result = DECL_RESULT (fndecl);
+  gcc_assert (result != NULL_TREE);
   if (aggregate_value_p (result, fndecl))
     {
 #ifdef PCC_STATIC_STRUCT_RETURN

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-11-20 19:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-12 12:03 Rafael Ávila de Espíndola
2005-11-15  0:33 ` Jim Wilson
2005-11-15  2:17   ` Gabriel Dos Reis
2005-11-15  2:40     ` James E Wilson
2005-11-15 21:30   ` Rafael Ávila de Espíndola
2005-11-18  1:35     ` Jim Wilson
2005-11-20 19:58       ` Rafael Ávila de Espíndola [this message]
2005-11-21 21:19         ` James E Wilson

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=200511201801.59206.rafael.espindola@gmail.com \
    --to=rafael.espindola@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=wilson@specifix.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).