From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8718 invoked by alias); 30 Sep 2008 16:34:41 -0000 Received: (qmail 5795 invoked by uid 48); 30 Sep 2008 16:33:11 -0000 Date: Tue, 30 Sep 2008 16:34:00 -0000 Subject: [Bug c/37684] New: [graphite] basic block containing VDEF of a scalar does not dominate basic block containing VUSE of the same scalar X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "hjagasia at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-09/txt/msg03040.txt.bz2 When translate_clast is called for a scop, scalar definitions are optimized out and hence any subsequent uses of those scalars, outside the scop, represents a problem. Also as code is generated for a scop, basic blocks in the scop are moved around such that the block which contains the definition of a scalar no longer dominates the basic block outside the scop which contains a use of that scalar. Attached reduced testcase block-3.c (derived from cpu2006-401.bzip2-bzlib.c) fails in gloog->verify_ssa->verify_use at below: >>> else if (bb != def_bb && !dominated_by_p (CDI_DOMINATORS, bb, def_bb)) { error ("definition in block %i does not dominate use in block %i", def_bb->index, bb->index); err = true; } >>> Before translate_clast is called, here is an excerpt from the function: : # SMT.48_24 = PHI # i_28 = PHI # SMT.49_29 = PHI # SMT.48_20 = VDEF # SMT.49_21 = VDEF s_5->inUse[i_28] = 0; i_10 = i_28 + 1; if (i_10 <= 255) goto ; else goto ; : goto ; : : # VUSE D.1656_11 = s_5->blockNo; D.1657_12 = D.1656_11 + 1; # SMT.48_22 = VDEF # SMT.49_23 = VDEF s_5->blockNo = D.1657_12; return; At this point bb 3 which contains the VDEF for SMT.48_20 and SMT.49_21 dominates bb 6 which contains the VUSE for the same. The VDEF is associated with s_5->blockNo and the VUSE with s_5->inUse[i_28]. After translate_clast is called, here is an excerpt from the function: BZ2_bzCompressInit (struct bz_stream * strm, int blockSize100k, int verbosity, int workFactor) { struct EState * D.1728; int D.1725; int D.1726; int D.1727; int graphiteIV.63; int graphiteIV.62; Int32 pretmp.52; int D.1656; int D.1657; Int32 i; struct EState * s; void * D.1643; void * D.1642; void * (*) (void *, int, int) D.1641; : # VUSE D.1641_2 = strm_1(D)->bzalloc; # VUSE D.1642_3 = strm_1(D)->opaque; # SMT.47_17 = VDEF # SMT.48_18 = VDEF # SMT.49_19 = VDEF D.1643_4 = D.1641_2 (D.1642_3, 304, 1); s_5 = (struct EState *) D.1643_4; : # graphiteIV.62_13 = PHI <0(2), graphiteIV.62_6(8)> graphiteIV.62_6 = graphiteIV.62_13 + 1; if (graphiteIV.62_6 <= 3) goto ; else goto ; : graphiteIV.63_9 = graphiteIV.62_13 * 64; : # graphiteIV.63_27 = PHI # SMT.48_24 = PHI <> # SMT.49_29 = PHI <> graphiteIV.63_25 = graphiteIV.63_27 + 1; D.1725_26 = graphiteIV.62_13 * 64; D.1726_30 = D.1725_26 + 63; D.1727_31 = MIN_EXPR ; if (graphiteIV.63_25 <= D.1727_31) goto ; else goto ; : goto ; : goto ; : Invalid sum of outgoing probabilities 0.0% Invalid sum of incoming frequencies 25, should be 9900 D.1728_32 = (struct EState *) D.1643_4; D.1728_32->inUse[graphiteIV.63_27] = 0; goto ; : Invalid sum of incoming frequencies 0, should be 9800 : : # VUSE D.1656_11 = s_5->blockNo; D.1657_12 = D.1656_11 + 1; # SMT.48_22 = VDEF # SMT.49_23 = VDEF s_5->blockNo = D.1657_12; return; } During translate_clast the scop is transformed and the scalar VDEFS for SMT.48_20, SMT.49_21 are removed by graphite. Also bb 3 no longer dominates bb 6. -- Summary: [graphite] basic block containing VDEF of a scalar does not dominate basic block containing VUSE of the same scalar Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: hjagasia at gcc dot gnu dot org ReportedBy: hjagasia at gcc dot gnu dot org GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37684