public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bergner at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/51895] [4.7 Regression] ICE in simplify_subreg
Date: Thu, 19 Jan 2012 04:17:00 -0000	[thread overview]
Message-ID: <bug-51895-4-iTsrdTEzHC@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-51895-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51895

--- Comment #1 from Peter Bergner <bergner at gcc dot gnu.org> 2012-01-19 02:42:44 UTC ---
We ICE when we try and do a BLK move from a reg:TI.  In GCC 4.6, we don't see
this, since the args[i].tree_value is different:

(gdb-gcc4.6) ptree args[i].tree_value
 <var_decl 0xfffaa5703c0 Ptr1
    type <record_type 0xfffafd6f960 SDValue sizes-gimplified needs-constructing
type_1 type_5 type_6 TI
        size <integer_cst 0xfffb6d50a00 constant 128>
        unit size <integer_cst 0xfffb6d50a28 constant 16>
        align 64 symtab 0 alias set 43 canonical type 0xfffafd6f960
        fields <field_decl 0xfffaec22ee8 Node type <pointer_type 0xfffafd6fab0>
            used private unsigned nonlocal decl_3 DI file t.ii line 30433 col
11
            size <integer_cst 0xfffb6d50870 constant 64>
            unit size <integer_cst 0xfffb6d50898 constant 8>
            align 64 offset_align 128
            offset <integer_cst 0xfffb6d504d8 constant 0>
            bit offset <integer_cst 0xfffb6d50fa0 constant 0> context
<record_type 0xfffafd6f960 SDValue> chain <field_decl 0xfffaec22f80 ResNo>>
context <namespace_decl 0xfffb2ef1368 llvm>
        full-name "class llvm::SDValue"
        needs-constructor X() X(constX&) this=(X&) n_parents=0 use_template=0
interface-unknown
        pointer_to_this <pointer_type 0xfffafd6fca8> reference_to_this
<reference_type 0xfffafe27818> chain <type_decl 0xfffaebe9d68 SDValue>>
    used TI file t.ii line 45352 col 9 size <integer_cst 0xfffb6d50a00 128>
unit size <integer_cst 0xfffb6d50a28 16>
    align 64 context <function_decl 0xffface9a300 FindBetterChain>
abstract_origin <parm_decl 0xfffae3bf1b8 Ptr1>
    (reg/v:TI 306 [ Ptr1 ])>

versus for gcc 4.7:

(gdb-gc4.7) ptree args[i].tree_value
 <mem_ref 0xfffa8e935a0
    type <array_type 0xfffb0cac198
        type <integer_type 0xfffb5e403f0 char sizes-gimplified public unsigned
string-flag type_6 QI
            size <integer_cst 0xfffb5d527e0 constant 8>
            unit size <integer_cst 0xfffb5d52800 constant 1>
            align 8 symtab 0 alias set -1 canonical type 0xfffb5e403f0
precision 8 min <integer_cst 0xfffb5d52860 0> max <integer_cst 0xfffb5d52880
255>
            pointer_to_this <pointer_type 0xfffb5e43288> reference_to_this
<reference_type 0xfffb5e4e700>>
        BLK
        size <integer_cst 0xfffb2c63bc0 constant 96>
        unit size <integer_cst 0xfffb2c63540 constant 12>
        align 8 symtab 0 alias set 0 canonical type 0xfffb0cac198
        domain <integer_type 0xfffb0cac0f0 type <integer_type 0xfffb5e40000
sizetype>
            DI
            size <integer_cst 0xfffb5d52600 constant 64>
            unit size <integer_cst 0xfffb5d52620 constant 8>
            align 64 symtab 0 alias set -1 canonical type 0xfffb0cac0f0
precision 64 min <integer_cst 0xfffb5d52640 0> max <integer_cst 0xfffb2c6f020
11>>
        pointer_to_this <pointer_type 0xfffa2f99cd8>>

    arg 0 <addr_expr 0xfffa3d2a708
        type <pointer_type 0xfffa8d50b28 type <record_type 0xfffa8d505e8
SDValue>
            sizes-gimplified public unsigned type_6 DI size <integer_cst
0xfffb5d52600 64> unit size <integer_cst 0xfffb5d52620 8>
            align 64 symtab 0 alias set 2 canonical type 0xfffa8d50b28
            pointer_to_this <pointer_type 0xfffa3834cc8>>

        arg 0 <var_decl 0xfffa362ee20 Ptr1 type <record_type 0xfffa8d505e8
SDValue>
            used TI file t.ii line 45286 col 6
            size <integer_cst 0xfffb5d526a0 constant 128>
            unit size <integer_cst 0xfffb5d526c0 constant 16>
            align 64 context <function_decl 0xfffa2db2700 GatherAllAliases>
abstract_origin <parm_decl 0xfffa32f8ff8 Ptr1>
            (reg/v:TI 279 [ Ptr1 ])>>
    arg 1 <integer_cst 0xfffa9014f00 type <pointer_type 0xfffa8d50b28> constant
0>>

That difference forces us down different paths starting at this
load_register_parameters() test:

   else if (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode)

For 4.6, the mode is a TImode and for 4.7, it's a BLKmode.  The following patch
seems to fix it:

Index: gcc/emit-rtl.c
===================================================================
--- gcc/emit-rtl.c (revision 183280)
+++ gcc/emit-rtl.c (working copy)
@@ -1401,6 +1401,9 @@ operand_subword (rtx op, unsigned int of
  return replace_equiv_address (new_rtx, XEXP (new_rtx, 0));
     }

+  if (REG_P (op) && mode == BLKmode)
+    mode = GET_MODE (op);
+
   /* Rest can be handled by simplify_subreg.  */
   return simplify_gen_subreg (word_mode, op, mode, (offset * UNITS_PER_WORD));
 }


I'm bootstraping/regtesting this patch now.


  reply	other threads:[~2012-01-19  2:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19  2:22 [Bug middle-end/51895] New: " jakub at gcc dot gnu.org
2012-01-19  4:17 ` bergner at gcc dot gnu.org [this message]
2012-01-19  8:19 ` [Bug middle-end/51895] " jakub at gcc dot gnu.org
2012-01-19 10:16 ` rguenth at gcc dot gnu.org
2012-01-19 10:47 ` jakub at gcc dot gnu.org
2012-01-19 12:47 ` jakub at gcc dot gnu.org
2012-01-19 13:12 ` rguenth at gcc dot gnu.org
2012-01-19 13:32 ` jakub at gcc dot gnu.org
2012-01-19 13:38 ` rguenth at gcc dot gnu.org
2012-01-19 14:07 ` jakub at gcc dot gnu.org
2012-01-19 16:28 ` ebotcazou at gcc dot gnu.org
2012-01-20  9:42 ` jakub at gcc dot gnu.org
2012-01-20  9:54 ` ebotcazou at gcc dot gnu.org
2012-01-20 14:36 ` rguenth at gcc dot gnu.org
2012-01-20 14:38 ` rguenth at gcc dot gnu.org
2012-01-20 15:30 ` rguenth at gcc dot gnu.org
2012-01-20 17:23 ` jakub at gcc dot gnu.org
2012-01-23 12:37 ` rguenth at gcc dot gnu.org
2012-01-26 14:58 ` jakub at gcc dot gnu.org
2012-01-26 15:03 ` jakub at gcc dot gnu.org

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=bug-51895-4-iTsrdTEzHC@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).