From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4280 invoked by alias); 9 Jan 2013 22:57:11 -0000 Received: (qmail 4271 invoked by uid 22791); 9 Jan 2013 22:57:10 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from qmta13.westchester.pa.mail.comcast.net (HELO qmta13.westchester.pa.mail.comcast.net) (76.96.59.243) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Jan 2013 22:57:03 +0000 Received: from omta15.westchester.pa.mail.comcast.net ([76.96.62.87]) by qmta13.westchester.pa.mail.comcast.net with comcast id lpiX1k0011swQuc5Dyx3sd; Wed, 09 Jan 2013 22:57:03 +0000 Received: from bag6-1-pt.tunnel.tserv3.fmt2.ipv6.he.net ([IPv6:2001:470:1f04:ae1::2]) by omta15.westchester.pa.mail.comcast.net with comcast id lyx11k00M0P3DwE3byx2us; Wed, 09 Jan 2013 22:57:03 +0000 From: Mike Stump Content-Type: multipart/mixed; boundary="Apple-Mail=_0C115A40-431A-46A4-B98F-B71352C65EDA" Subject: unnecessary assert Date: Wed, 09 Jan 2013 22:57:00 -0000 Message-Id: <55327D81-C743-4A22-890C-3FD6AC859577@comcast.net> Cc: Jakub Jelinek , Diego Novillo To: "gcc-patches@gcc.gnu.org Patches" Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00509.txt.bz2 --Apple-Mail=_0C115A40-431A-46A4-B98F-B71352C65EDA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Content-length: 2370 I found an assert that trips on my port for trivial constructs, often. I'd= like to remove it, so that my port works better. The assert was added bec= ause the case analysis he did was for when BLKmode MEM stores appeared in b= ack when he wrote the patch (Hi Jakub). He didn't analyze when dealing wit= h a non-BLKmode. I've been through the code, and it previously handled non= -BLKmode when the size was <=3D HOST_BITS_PER_WIDE_INT, so, I don't worry a= bout that aspect of it. Indeed, the very assert was originally directly abo= ve code that was not more than HOST_BITS_PER_WIDE_INT bits safe: - gcc_assert ((unsigned) width <=3D HOST_BITS_PER_WIDE_INT); -=20=20 /* Finish filling in the store_info. */ store_info->next =3D insn_info->store_rec; insn_info->store_rec =3D store_info; store_info->mem =3D canon_rtx (mem); store_info->alias_set =3D spill_alias_set; store_info->mem_addr =3D get_addr (XEXP (mem, 0)); store_info->cse_base =3D base; - store_info->positions_needed =3D lowpart_bitmask (width); + if (width > HOST_BITS_PER_WIDE_INT) + { + store_info->is_large =3D true; + store_info->positions_needed.large.count =3D 0; + store_info->positions_needed.large.bitmap =3D BITMAP_ALLOC (NULL); + } + else + { + store_info->is_large =3D false; + store_info->positions_needed.small_bitmask =3D lowpart_bitmask (widt= h); + } The new code in that patch added support for BLKmode with sizes > HOST_BITS= _PER_WIDE_INT. The assert was to protect the positions_needed, as it wasn'= t big enough to handle any data larger than HOST_BITS_PER_WIDE_INT. The pr= evious patch now supports larger data and mediates access to positions_need= ed based upon is_large, which is necessary.=20=20 The only outstanding question is, is there any other aspect of the code tha= t needs to now check is_large, that doesn't. I've looked and did not find = any other such code. [ digging ] Ah, the original assert was added in: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134199 and merely protected positions_needed, as I suspected. Ok? Ok for 2.8? http://gcc.gnu.org/PR31150 is the PR when the assert was added, if you want= to see it. svn+ssh://gcc.gnu.org/svn/gcc/trunk@142892 is the change itsel= f. 2013-01-09 Mike Stump * dse.c (record_store): Remove unnecessary assert. --Apple-Mail=_0C115A40-431A-46A4-B98F-B71352C65EDA Content-Disposition: attachment; filename=dse.diffs.txt Content-Type: text/plain; name="dse.diffs.txt" Content-Transfer-Encoding: 7bit Content-length: 574 2013-01-09 Mike Stump * dse.c (record_store): Remove unnecessary assert. Index: dse.c =================================================================== --- dse.c (revision 195067) +++ dse.c (working copy) @@ -1495,10 +1495,7 @@ record_store (rtx body, bb_info_t bb_inf if (GET_MODE (mem) == BLKmode) width = MEM_SIZE (mem); else - { - width = GET_MODE_SIZE (GET_MODE (mem)); - gcc_assert ((unsigned) width <= HOST_BITS_PER_WIDE_INT); - } + width = GET_MODE_SIZE (GET_MODE (mem)); if (spill_alias_set) { --Apple-Mail=_0C115A40-431A-46A4-B98F-B71352C65EDA--