public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: rth@redhat.com
Cc: gcc@gcc.gnu.org
Subject: Re: host_integerp vs [] decls
Date: Wed, 19 Sep 2001 12:21:00 -0000	[thread overview]
Message-ID: <200109191921.PAA10620@greed.delorie.com> (raw)
In-Reply-To: <20010914144112.B15655@redhat.com>

> Yep, we've forgotten that [] arrays have no MAX_VALUE in the array.
> 
> Should be something like
> 
>       int const_bounds_p = (TYPE_MIN_VALUE (domain) && TYPE_MAX_VALUE (domain)
> 			    && host_integerp (TYPE_MIN_VALUE (domain), 0)
>                             && host_integerp (TYPE_MAX_VALUE (domain), 0));

Is it time for this change yet?  If so, should I get rid of all the
`constructor_max_index == 0' tests too, and just assume it's never
zero?

Index: c-typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-typeck.c,v
retrieving revision 1.137
diff -p -3 -r1.137 c-typeck.c
*** c-typeck.c	2001/09/16 00:48:52	1.137
--- c-typeck.c	2001/09/19 19:17:08
*************** push_init_level (implicit)
*** 5356,5365 ****
  	    = convert (bitsizetype, 
  		       TYPE_MIN_VALUE (TYPE_DOMAIN (constructor_type)));
  
! 	  /* ??? For GCC 3.1, remove special case initialization of
! 	     zero-length array members from pop_init_level and set
! 	     constructor_max_index such that we get the normal
! 	     "excess elements" warning.  */
  	}
        else
  	constructor_index = bitsize_zero_node;
--- 5356,5364 ----
  	    = convert (bitsizetype, 
  		       TYPE_MIN_VALUE (TYPE_DOMAIN (constructor_type)));
  
! 	  /* Detect non-empty initializations of zero-length arrays.  */
! 	  if (constructor_max_index == NULL_TREE)
! 	    constructor_max_index = build_int_2 (-1, -1);
  	}
        else
  	constructor_index = bitsize_zero_node;

  parent reply	other threads:[~2001-09-19 12:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-14 12:54 DJ Delorie
2001-09-14 14:41 ` Richard Henderson
2001-09-14 14:47   ` DJ Delorie
2001-09-14 14:50     ` Richard Henderson
2001-09-14 18:33   ` DJ Delorie
2001-09-17 16:20     ` Richard Henderson
2001-09-19 12:21   ` DJ Delorie [this message]
2001-09-19 12:37     ` Richard Henderson
2001-09-19 12:44       ` DJ Delorie
2001-09-19 13:10       ` DJ Delorie
2001-09-19 13:36         ` Richard Henderson
2001-09-19 18:10           ` DJ Delorie
2001-09-20  2:04             ` Franz Sirl
2001-09-20  9:40               ` DJ Delorie
2001-09-20 14:06             ` Richard Henderson
2001-09-20 17:28               ` DJ Delorie
2001-09-20 18:00           ` Zack Weinberg
2001-09-20 18:11             ` DJ Delorie
2001-09-14 16:26 Richard Kenner

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=200109191921.PAA10620@greed.delorie.com \
    --to=dj@redhat.com \
    --cc=gcc@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).