From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5487 invoked by alias); 1 Aug 2012 19:14:35 -0000 Received: (qmail 5478 invoked by uid 22791); 1 Aug 2012 19:14:34 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-vb0-f47.google.com (HELO mail-vb0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Aug 2012 19:14:18 +0000 Received: by vbbfr13 with SMTP id fr13so7648783vbb.20 for ; Wed, 01 Aug 2012 12:14:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.240.228 with SMTP id wd4mr15532866vdc.95.1343848458034; Wed, 01 Aug 2012 12:14:18 -0700 (PDT) Received: by 10.58.165.104 with HTTP; Wed, 1 Aug 2012 12:14:17 -0700 (PDT) In-Reply-To: <87a9ye1lsh.fsf@talisman.home> References: <20120801184138.GA3787@intel.com> <87a9ye1lsh.fsf@talisman.home> Date: Wed, 01 Aug 2012 19:14:00 -0000 Message-ID: Subject: Re: PATCH: PR rtl-optimization/54157: [x32] -maddress-mode=long failures From: "H.J. Lu" To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Content-Type: text/plain; charset=ISO-8859-1 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: 2012-08/txt/msg00053.txt.bz2 On Wed, Aug 1, 2012 at 11:58 AM, Richard Sandiford wrote: > "H.J. Lu" writes: >> We have >> >> (gdb) r -fpreprocessed x.i -quiet -dumpbase x.i -mx32 >> -maddress-mode=long -mtune=generic -march=x86-64 -auxbase x -O2 -version >> -ftree-vectorize -o x.s >> Starting program: /export/build/gnu/gcc-x32/build-x86_64-linux/gcc/cc1 >> -fpreprocessed x.i -quiet -dumpbase x.i -mx32 -maddress-mode=long >> -mtune=generic -march=x86-64 -auxbase x -O2 -version -ftree-vectorize -o >> x.s >> GNU C (GCC) version 4.8.0 20120801 (experimental) >> (x86_64-unknown-linux-gnu) >> compiled by GNU C version 4.7.1 20120629 (Red Hat 4.7.1-1), GMP >> version 5.0.2, MPFR version 3.1.0, MPC version 0.9 >> GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 >> GNU C (GCC) version 4.8.0 20120801 (experimental) >> (x86_64-unknown-linux-gnu) >> compiled by GNU C version 4.7.1 20120629 (Red Hat 4.7.1-1), GMP >> version 5.0.2, MPFR version 3.1.0, MPC version 0.9 >> GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 >> Compiler executable checksum: 07a4e516c4e8fe4abfdafa83737d8f4a >> >> Breakpoint 1, fancy_abort ( >> file=0x130fe68 "/export/gnu/import/git/gcc/gcc/explow.c", line=88, >> function=0x131032e <__FUNCTION__.39220> "plus_constant") >> at /export/gnu/import/git/gcc/gcc/diagnostic.c:1011 >> 1011 internal_error ("in %s, at %s:%d", function, trim_filename >> (file), line); >> (gdb) f 1 >> #1 0x0000000000743e07 in plus_constant (mode=DImode, x=0x7ffff106a7e0, >> c=99452) at /export/gnu/import/git/gcc/gcc/explow.c:88 >> 88 gcc_assert (GET_MODE (x) == VOIDmode || GET_MODE (x) == mode); >> (gdb) f 2 >> #2 0x0000000000adc4b1 in simplify_binary_operation_1 (code=PLUS, >> mode=DImode, >> op0=0x7ffff106a7e0, op1=0x7ffff1010e80, trueop0=0x7ffff106a7e0, >> trueop1=0x7ffff1010e80) >> at /export/gnu/import/git/gcc/gcc/simplify-rtx.c:1956 >> 1956 return plus_constant (mode, op0, INTVAL (op1)); >> (gdb) call debug_rtx (op0) >> (symbol_ref:SI ("tmp2") ) >> (gdb) call debug_rtx (op1) >> (const_int 99452 [0x1847c]) >> (gdb) bt >> #0 fancy_abort (file=0x130fe68 >> "/export/gnu/import/git/gcc/gcc/explow.c", >> line=88, function=0x131032e <__FUNCTION__.39220> "plus_constant") >> at /export/gnu/import/git/gcc/gcc/diagnostic.c:1011 >> #1 0x0000000000743e07 in plus_constant (mode=DImode, x=0x7ffff106a7e0, >> c=99452) at /export/gnu/import/git/gcc/gcc/explow.c:88 >> #2 0x0000000000adc4b1 in simplify_binary_operation_1 (code=PLUS, >> mode=DImode, >> op0=0x7ffff106a7e0, op1=0x7ffff1010e80, trueop0=0x7ffff106a7e0, >> trueop1=0x7ffff1010e80) >> at /export/gnu/import/git/gcc/gcc/simplify-rtx.c:1956 >> #3 0x0000000000adc221 in simplify_binary_operation (code=PLUS, >> mode=DImode, >> op0=0x7ffff106a7e0, op1=0x7ffff1010e80) >> at /export/gnu/import/git/gcc/gcc/simplify-rtx.c:1904 > > Things have already gone wrong by this frame: we have a DImode > addition of an SImode value, which isn't allowed. Where does > that mismatch get introduced? > make_extraction in combine generates: 7474 inner = force_to_mode (inner, wanted_inner_mode, 7475 pos_rtx 7476 || len + orig_pos >= HOST_BITS_PER_WIDE_INT 7477 ? ~(unsigned HOST_WIDE_INT) 0 7478 : ((((unsigned HOST_WIDE_INT) 1 << len) - 1) (gdb) call debug_rtx (inner) (plus:SI (reg:SI 109 [ D.1765 ]) (const:SI (plus:SI (symbol_ref:SI ("tmp2") ) (const_int 99452 [0x1847c])))) (gdb) p wanted_inner_mode $2 = DImode (gdb) -- H.J.