From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18952 invoked by alias); 6 Apr 2011 17:03:18 -0000 Received: (qmail 18942 invoked by uid 22791); 6 Apr 2011 17:03:16 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-bw0-f47.google.com (HELO mail-bw0-f47.google.com) (209.85.214.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Apr 2011 17:03:12 +0000 Received: by bwz5 with SMTP id 5so1617638bwz.20 for ; Wed, 06 Apr 2011 10:03:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.74.21 with SMTP id s21mr1107503bkj.62.1302109387188; Wed, 06 Apr 2011 10:03:07 -0700 (PDT) Received: by 10.204.40.137 with HTTP; Wed, 6 Apr 2011 10:03:07 -0700 (PDT) In-Reply-To: References: Date: Wed, 06 Apr 2011 17:03:00 -0000 Message-ID: Subject: Re: PATCH: PR middle-end/48440: [4.7 Regression] FAIL: gcc.c-torture/compile/labels-3.c From: "H.J. Lu" To: Richard Guenther Cc: Paolo Bonzini , Michael Matz , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2011-04/txt/msg00490.txt.bz2 On Tue, Apr 5, 2011 at 3:29 AM, Richard Guenther wrote: > On Tue, Apr 5, 2011 at 8:44 AM, Paolo Bonzini wrote: >>>>> Index: cgraphbuild.c >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>> --- cgraphbuild.c.orig =A02011-04-03 11:28:45.000000000 +0200 >>>>> +++ cgraphbuild.c =A0 =A0 =A0 2011-04-03 11:31:21.000000000 +0200 >>>>> @@ -53,6 +53,12 @@ record_reference (tree *tp, int *walk_su >>>>> =A0 tree decl; >>>>> =A0 struct record_reference_ctx *ctx =3D (struct record_reference_ctx= *)data; >>>>> >>>>> + =A0t =3D canonicalize_constructor_val (t); >>>>> + =A0if (!t) >>>>> + =A0 =A0t =3D *tp; >>>>> + =A0else if (t !=3D *tp) >>>>> + =A0 =A0*tp =3D t; >>>>> + >>>>> =A0 switch (TREE_CODE (t)) >>>>> =A0 =A0 { >>>>> =A0 =A0 case VAR_DECL: >>>> >>>> This change caused: >>>> >>>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D48440 >>>> >>> >>> This avoids =A0canonicalizing constructor values for address conversion >>> if Pmode !=3D ptr_mode. =A0OK for trunk? >> >> Certainly the right place to fix it is in canonicalize_constructor_val i= tself. > > There should never be any Pmode pointer types in the gimple IL. =A0The > proper place to fix it if any is in useless_type_conversion_p. > We have 5600 newx =3D simplify_subreg (outermode, op, innermode, byte); (gdb) f 1 #1 0x0000000000708494 in expand_expr_real_2 (ops=3D0x7fffffffb0c0, target= =3D0x0, tmode=3DVOIDmode, modifier=3DEXPAND_INITIALIZER) at /export/gnu/import/git/gcc-x32/gcc/expr.c:7366 7366 op0 =3D simplify_gen_subreg (mode, op0, inner_mode, (gdb) call debug_tree (treeop0) > sizes-gimplified public unsigned SI size unit size align 32 symtab 0 alias set -1 canonical type 0x7ffff0b83f18 pointer_to_this > constant arg 0 side-effects VOID file x.i line 8 col 2 align 1 context initial (code_label/s 22 0 0 4 4 ("l2") [2 uses]) chain used unsigned SI file x.i line 4 col 9 size unit size align 32 context (mem/f/c/i:SI (plus:DI (reg/f:DI 20 frame) (const_int -4 [0xfffffffffffffffc])) [0 p+0 S4 A32])>> x.i:3:44> (gdb) call debug_rtx (op0) (label_ref/v:DI 22) (gdb) Since ptr_mode !=3D Pmode, the type of op0 !=3D type of treeop0. Should we use GET_MODE (op0) instead of TYPE_MODE (inner_type) here? Does this patch make any senses? --=20 H.J. --- diff --git a/gcc/expr.c b/gcc/expr.c index d521f64..439f245 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -7360,7 +7360,7 @@ expand_expr_real_2 (sepops ops, rtx target, enum mach= ine_m ode tmode, else if (CONSTANT_P (op0)) { tree inner_type =3D TREE_TYPE (treeop0); - enum machine_mode inner_mode =3D TYPE_MODE (inner_type); + enum machine_mode inner_mode =3D GET_MODE (op0); if (modifier =3D=3D EXPAND_INITIALIZER) op0 =3D simplify_gen_subreg (mode, op0, inner_mode,