public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Fixup missing host_integerp call
Date: Mon, 11 Apr 2011 15:48:00 -0000	[thread overview]
Message-ID: <alpine.LNX.2.00.1104111748040.810@zhemvz.fhfr.qr> (raw)


This fixes a missed check before calling tree_int_cst_low.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2011-04-11  Richard Guenther  <rguenther@suse.de>

	* gimplify.c (gimple_fold_indirect_ref): Check host_integerp
	before calling tree_low_cst.

Index: gcc/gimplify.c
===================================================================
*** gcc/gimplify.c	(revision 172252)
--- gcc/gimplify.c	(working copy)
*************** gimple_fold_indirect_ref (tree t)
*** 4079,4087 ****
        /* ((foo*)&vectorfoo)[1] -> BIT_FIELD_REF<vectorfoo,...> */
        if (TREE_CODE (addr) == ADDR_EXPR
  	  && TREE_CODE (TREE_TYPE (addrtype)) == VECTOR_TYPE
! 	  && useless_type_conversion_p (type, TREE_TYPE (TREE_TYPE (addrtype))))
  	{
!           HOST_WIDE_INT offset = tree_low_cst (off, 0);
            tree part_width = TYPE_SIZE (type);
            unsigned HOST_WIDE_INT part_widthi
              = tree_low_cst (part_width, 0) / BITS_PER_UNIT;
--- 4079,4088 ----
        /* ((foo*)&vectorfoo)[1] -> BIT_FIELD_REF<vectorfoo,...> */
        if (TREE_CODE (addr) == ADDR_EXPR
  	  && TREE_CODE (TREE_TYPE (addrtype)) == VECTOR_TYPE
! 	  && useless_type_conversion_p (type, TREE_TYPE (TREE_TYPE (addrtype)))
! 	  && host_integerp (off, 1))
  	{
!           unsigned HOST_WIDE_INT offset = tree_low_cst (off, 1);
            tree part_width = TYPE_SIZE (type);
            unsigned HOST_WIDE_INT part_widthi
              = tree_low_cst (part_width, 0) / BITS_PER_UNIT;

                 reply	other threads:[~2011-04-11 15:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=alpine.LNX.2.00.1104111748040.810@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    /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).