diff mbox

patch to fix PR61325

Message ID 538F6CE3.6000105@redhat.com
State New
Headers show

Commit Message

Vladimir Makarov June 4, 2014, 7 p.m. UTC
On 2014-06-03, 6:02 PM, James Greenhalgh wrote:
> On Thu, May 29, 2014 at 06:38:22PM +0100, Vladimir Makarov wrote:
>>    The following patch PR61325.  The details can be found on
>>
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61325
>>
>>    The patch was bootstrapped and tested on x86/x86-64.
>>
>>    Committed as rev. 211060 to gcc-4.9 branch and as rev.211061 to trunk.
>>
>> 2014-05-29  Vladimir Makarov  <vmakarov@redhat.com>
>>
>>          PR rtl-optimization/61325
>>          * lra-constraints.c (process_address): Rename to
>>          process_address_1.
>>          (process_address): New function.
>>
>> 2014-05-29  Vladimir Makarov  <vmakarov@redhat.com>
>>
>>          PR rtl-optimization/61325
>>          * gcc.target/aarch64/pr61325.c: New.
>
> Hi Vlad,
>
> This patch appears to cause issues where the ARM backend can get stuck in a
> seemingly infinite loop.
>
> Compiling:
>
> ./gcc.c-torture/compile/unalign-1.c
>

Sorry for inconvenience.

Could you test the following patch



If it is ok, I'll commit it as soon as possible.
I checked the patch on x86/x86-64.  The patch is ok for this platform.

Comments

James Greenhalgh June 5, 2014, 12:37 p.m. UTC | #1
On Wed, Jun 04, 2014 at 08:00:51PM +0100, Vladimir Makarov wrote:
> On 2014-06-03, 6:02 PM, James Greenhalgh wrote:
> > On Thu, May 29, 2014 at 06:38:22PM +0100, Vladimir Makarov wrote:
> >>    The following patch PR61325.  The details can be found on
> >>
> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61325
> >>
> >>    The patch was bootstrapped and tested on x86/x86-64.
> >>
> >>    Committed as rev. 211060 to gcc-4.9 branch and as rev.211061 to trunk.
> >>
> >> 2014-05-29  Vladimir Makarov  <vmakarov@redhat.com>
> >>
> >>          PR rtl-optimization/61325
> >>          * lra-constraints.c (process_address): Rename to
> >>          process_address_1.
> >>          (process_address): New function.
> >>
> >> 2014-05-29  Vladimir Makarov  <vmakarov@redhat.com>
> >>
> >>          PR rtl-optimization/61325
> >>          * gcc.target/aarch64/pr61325.c: New.
> >
> > Hi Vlad,
> >
> > This patch appears to cause issues where the ARM backend can get stuck in a
> > seemingly infinite loop.
> >
> > Compiling:
> >
> > ./gcc.c-torture/compile/unalign-1.c
> >
> 
> Sorry for inconvenience.
> 
> Could you test the following patch

Hi Vlad,

The patch works for me. I've bootstrapped and tested it on
arm-none-linux-gnueabihf. It has also had a regression run on aarch64-none-elf.
Cristophe, did you get a chance to do any more thorough testing of the patch?

From my perspective, I think this should go in, and be backported to 4.9.

Thanks,
James
Christophe Lyon June 5, 2014, 1:21 p.m. UTC | #2
On 5 June 2014 14:37, James Greenhalgh <james.greenhalgh@arm.com> wrote:
> On Wed, Jun 04, 2014 at 08:00:51PM +0100, Vladimir Makarov wrote:
>> On 2014-06-03, 6:02 PM, James Greenhalgh wrote:
>> > On Thu, May 29, 2014 at 06:38:22PM +0100, Vladimir Makarov wrote:
>> >>    The following patch PR61325.  The details can be found on
>> >>
>> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61325
>> >>
>> >>    The patch was bootstrapped and tested on x86/x86-64.
>> >>
>> >>    Committed as rev. 211060 to gcc-4.9 branch and as rev.211061 to trunk.
>> >>
>> >> 2014-05-29  Vladimir Makarov  <vmakarov@redhat.com>
>> >>
>> >>          PR rtl-optimization/61325
>> >>          * lra-constraints.c (process_address): Rename to
>> >>          process_address_1.
>> >>          (process_address): New function.
>> >>
>> >> 2014-05-29  Vladimir Makarov  <vmakarov@redhat.com>
>> >>
>> >>          PR rtl-optimization/61325
>> >>          * gcc.target/aarch64/pr61325.c: New.
>> >
>> > Hi Vlad,
>> >
>> > This patch appears to cause issues where the ARM backend can get stuck in a
>> > seemingly infinite loop.
>> >
>> > Compiling:
>> >
>> > ./gcc.c-torture/compile/unalign-1.c
>> >
>>
>> Sorry for inconvenience.
>>
>> Could you test the following patch
>
> Hi Vlad,
>
> The patch works for me. I've bootstrapped and tested it on
> arm-none-linux-gnueabihf. It has also had a regression run on aarch64-none-elf.
> Cristophe, did you get a chance to do any more thorough testing of the patch?
>
> From my perspective, I think this should go in, and be backported to 4.9.
>
> Thanks,
> James
>
>

I did run the tests and saw several regressions. As I wasn't very
confident, I have relaunched my tests, they are still running.

Christophe.
diff mbox

Patch

Index: lra-constraints.c
===================================================================
--- lra-constraints.c   (revision 211061)
+++ lra-constraints.c   (working copy)
@@ -2974,6 +2974,13 @@  process_address_1 (int nop, rtx *before,
        *ad.inner = simplify_gen_binary (PLUS, GET_MODE (new_reg),
                                        new_reg, *ad.index);
      }
+  else if (get_index_scale (&ad) == 1)
+    {
+      /* The last transformation to one reg will be made in
+        curr_insn_transform function.  */
+      end_sequence ();
+      return false;
+    }
    else
      {
        /* base + scale * index => base + new_reg,