This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR middle-end/20030, fold_indirect_ref and non zero lower bounds
- From: Richard Henderson <rth at redhat dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: gcc-patches Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 17 Feb 2005 10:26:04 -0800
- Subject: Re: [PATCH] Fix PR middle-end/20030, fold_indirect_ref and non zero lower bounds
- References: <2b322130c6bcf2a86802642f7b7c93b7@physics.uc.edu>
On Thu, Feb 17, 2005 at 12:44:37PM -0500, Andrew Pinski wrote:
> - return build4 (ARRAY_REF, type, op, size_zero_node, NULL_TREE, NULL_TREE);
> + {
> + tree min_val = TYPE_MIN_VALUE (TYPE_DOMAIN (optype));
> + return build4 (ARRAY_REF, type, op, min_val, NULL_TREE, NULL_TREE);
> + }
TYPE_DOMAIN isn't always set. Neither is TYPE_MIN_VALUE.
You need to check for nulls and use zero.
r~