diff mbox

[RFC,i386] : Remove peephole2s for (subreg (operator (...)(...))) RTXes

Message ID CAFULd4YMTJZHo_WueiQMEkyG3fVRzT9TivUnrqDskpqiZcCXVQ@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak Oct. 28, 2012, 9:13 a.m. UTC
On Sun, Oct 28, 2012 at 9:57 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Sun, Oct 28, 2012 at 2:37 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
>>>> As suggested by Richard S. [1], after the patch that converts subreg:M
>>>> (op:N (...)(...)) to op:M (subreg:M (...) subreg:M (...)), we can
>>>> remove several peephole2 patterns that handle subregs of PLUS, MINUS
>>>> and MULT operators. I have attached RFC prototype patch that will
>>>> trigger an ICE when to-be-removed pattern triggers, with the intention
>>>> that these patterns wil be removed entirely (An "invalid" pattern was
>>>> indeed generated elsewhere, see patch).
>>>>
>>>> 2012-10-18  Uros Bizjak  <ubizjak@gmail.com>
>>>>
>>>>         * config/i386/i386.md (ashift to lea splitter): Split to SImode mult.
>>>>         (simple lea to add/shift peephole2s): Remove peephole2s that operate
>>>>         on subregs of DImode operations.
>>>>         (*mov<mode>_insv_1_rex64): Use gen_int_mode to truncate
>>>>         const_int RTX to QImode value.
>>>>         (*movsi_insv_1): Ditto.
>>>>
>>>> The patch was bootstrapped and regression tested on
>>>> x86_64-pc-linux-gnu {,-m32} without problems, but I will ask H.J. to
>>>> test the patch on x32 before it is committed to mainline SVN.
>>>>
>>>> [1] http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01856.html
>>>>
>>>> Uros.
>>>
>>> I tested it on x32, ia32 and x86-64 with GCC testsuite and glibc.
>>> There are no GCC regressions on x32. However, for glibc trunk,
>>> on x32 and x86-64, I got
>>>
>>> make[4]: *** [/export/build/gnu/glibc-test/build-x86_64-linux/math/test-ildoubl.out]
>>> Error 1
>>> make[4]: *** [/export/build/gnu/glibc-test/build-x86_64-linux/math/test-ldouble.out]
>>> Error 1
>>>
>>> On ia32, I got
>>>
>>> make[4]: *** [/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-fenv.out]
>>> Error 1
>>> make[4]: *** [/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-ifloat.out]
>>> Error 1
>>> make[4]: *** [/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-idouble.out]
>>> Error 1
>>> make[4]: *** [/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-float.out]
>>> Error 1
>>> make[4]: *** [/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-double.out]
>>> Error 1
>>>
>>> I am testing if they are caused by the change.
>>>
>>
>> They are caused by this patch. I configure glibc with CFLAGS="-O3 -g"
>
> Can you please send me offline preprocessed sources to investigate
> this failure? There is another place in the code that generates subreg
> "by hand".

Maybe following patch helps:

--cut here--
--cut here--

Uros.
diff mbox

Patch

Index: i386.c
===================================================================
--- i386.c      (revision 192872)
+++ i386.c      (working copy)
@@ -11821,7 +11821,7 @@  ix86_decompose_address (rtx addr, struct ix86_addr
                return 0;
            }
          else if (GET_MODE (addr) == DImode)
-           addr = gen_rtx_SUBREG (SImode, addr, 0);
+           addr = simplify_gen_subreg (SImode, addr, DImode, 0);
          else if (GET_MODE (addr) != VOIDmode)
            return 0;
        }