From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68507 invoked by alias); 1 Jul 2015 11:58:12 -0000 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 Received: (qmail 68495 invoked by uid 89); 1 Jul 2015 11:58:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 01 Jul 2015 11:58:11 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36190) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ZAGeW-0000mF-L4 for gcc-patches@gnu.org; Wed, 01 Jul 2015 07:58:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAGeT-0002VY-5b for gcc-patches@gnu.org; Wed, 01 Jul 2015 07:58:06 -0400 Received: from mail-ob0-x232.google.com ([2607:f8b0:4003:c01::232]:34872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAGeT-0002Uw-0H for gcc-patches@gnu.org; Wed, 01 Jul 2015 07:58:05 -0400 Received: by obbop1 with SMTP id op1so26465004obb.2 for ; Wed, 01 Jul 2015 04:58:03 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.92.131 with SMTP id cm3mr24134360oeb.23.1435751883181; Wed, 01 Jul 2015 04:58:03 -0700 (PDT) Received: by 10.76.115.167 with HTTP; Wed, 1 Jul 2015 04:58:03 -0700 (PDT) In-Reply-To: <5593D276.6090504@mentor.com> References: <5593D276.6090504@mentor.com> Date: Wed, 01 Jul 2015 11:58:00 -0000 Message-ID: Subject: Re: [PATCH, PR66432] Handle PARM_DECL in remap_gimple_op_r From: Richard Biener To: Tom de Vries Cc: "gcc-patches@gnu.org" Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::232 X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00035.txt.bz2 On Wed, Jul 1, 2015 at 1:43 PM, Tom de Vries wrote: > Hi, > > I. > > When running test libgomp.c/appendix-a/a.29.1.c with '--target_board > unix/-O2/-g', we run into this failure: > ... > FAIL: libgomp.c/appendix-a/a.29.1.c (test for excess errors) > Excess errors: > src/libgomp/testsuite/libgomp.c/appendix-a/a.29.1.c:6:1: error: type > mismatch between an SSA_NAME and its symbol > ... > > Without -g, the testcase passes. > > > II. > > The scenario for the failure is as follows: > > At fnsplit, we split off f.part.0 from f, which at source level looks like > this: > ... > void > f (int n, int B[n][n], int C[]) > { > int D[2][2] = { 1, 2, 3, 4 }; > int E[n][n]; > assert (n >= 2); > E[1][1] = 4; > #pragma omp parallel firstprivate(B, C, D, E) > { > assert (sizeof (B) == sizeof (int (*)[n])); > assert (sizeof (C) == sizeof (int *)); > assert (sizeof (D) == 4 * sizeof (int)); > assert (sizeof (E) == n * n * sizeof (int)); > /* Private B and C have values of original B and C. */ > assert (&B[1][1] == &A[1][1]); > assert (&C[3] == &A[1][1]); > assert (D[1][1] == 4); > assert (E[1][1] == 4); > } > } > ... > > The split introduces a debug_insn and ssa-name that references param B in f: > ... > # DEBUG D#4ptD.0 => B_3(D) > .. > > And a debug_insn that references param B in f.part.0: > ... > # DEBUG D#7ptD.0 s=> BD.1846 > ... > > At this point, the type of the ssa name and the param are the same. With the same PARM_DECL? I think that's the bug. > Then at inline, we decide to inline f.part.0 back into function f. > > For inlining, we rewrite the body of inlined function f.part.0. While > rewriting the debug insn mentioned above, we hit this code for param B: > ... > if (TREE_CODE (*tp) != OMP_CLAUSE) > TREE_TYPE (*tp) = remap_type (TREE_TYPE (*tp), id); > ... > And since it's a variable-sized type, the type of param is changed. The param of the inlined body but that should be unrelated to that refered to by # DEBUG D#4ptD.0 => B_3(D) in f. > Now the type of the ssa name and the param are no longer the same, and a bit > later we hit the ICE. > > > III. > > Attached patch fixes the ICE by handling PARM_DECL in remap_gimple_op_r. > [ I'm not confident though this is the right fix ] > > Bootstrapped and reg-tested on x86_64. > > OK for trunk, or to be fixed otherwise? > > Thanks, > - Tom