Patchwork Bug fix for PR59050

login
register
mail settings
Submitter Cong Hou
Date Nov. 8, 2013, 6:34 p.m.
Message ID <CAK=A3=1acZi6iNaY8pAfSq4N6+NNGy7ei9emRCNcX3AZwx1BAg@mail.gmail.com>
Download mbox | patch
Permalink /patch/289907/
State New
Headers show

Comments

Cong Hou - Nov. 8, 2013, 6:34 p.m.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59050

This is my bad. I forget to check the test result for gfortran. With
this patch the bug should be fixed (tested on x86-64).


thanks,
Cong


       || TREE_CODE (p22.offset) != INTEGER_CST)
@@ -2680,9 +2680,9 @@ comp_dr_addr_with_seg_len_pair (const void *p1_,
const void *p2_)
       if (comp_res != 0)
        return comp_res;
     }
-  if (tree_int_cst_compare (p12.offset, p22.offset) < 0)
+  else if (tree_int_cst_compare (p12.offset, p22.offset) < 0)
     return -1;
-  if (tree_int_cst_compare (p12.offset, p22.offset) > 0)
+  else if (tree_int_cst_compare (p12.offset, p22.offset) > 0)
     return 1;

   return 0;
H.J. Lu - Nov. 8, 2013, 8:06 p.m.
On Fri, Nov 8, 2013 at 10:34 AM, Cong Hou <congh@google.com> wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59050
>
> This is my bad. I forget to check the test result for gfortran. With
> this patch the bug should be fixed (tested on x86-64).
>
>
> thanks,
> Cong
>
>
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index 90b01f2..e62c672 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,3 +1,8 @@
> +2013-11-08  Cong Hou  <congh@google.com>
> +
> +       PR tree-optimization/59050
> +       * tree-vect-data-refs.c (comp_dr_addr_with_seg_len_pair): Bug fix.
> +

Many SPEC CPU 2000 tests failed with

costab.c: In function 'HandleCoinc2':
costab.c:1565:17: internal compiler error: tree check: expected
integer_cst, have plus_expr in tree_int_cst_lt, at tree.c:7083
 void            HandleCoinc2 ( cos1, cos2, hdfactor )
                 ^
0xb6e084 tree_check_failed(tree_node const*, char const*, int, char const*, ...)
    ../../src-trunk/gcc/tree.c:9477
0xb6ffe4 tree_check
    ../../src-trunk/gcc/tree.h:2914
0xb6ffe4 tree_int_cst_lt(tree_node const*, tree_node const*)
    ../../src-trunk/gcc/tree.c:7083
0xb70020 tree_int_cst_compare(tree_node const*, tree_node const*)
    ../../src-trunk/gcc/tree.c:7093
0xe53f1c comp_dr_addr_with_seg_len_pair
    ../../src-trunk/gcc/tree-vect-data-refs.c:2672
0xe5cbb5 vec<dr_addr_with_seg_len_pair_t, va_heap,
vl_embed>::qsort(int (*)(void const*, void const*))
    ../../src-trunk/gcc/vec.h:941
0xe5cbb5 vec<dr_addr_with_seg_len_pair_t, va_heap, vl_ptr>::qsort(int
(*)(void const*, void const*))
    ../../src-trunk/gcc/vec.h:1620
0xe5cbb5 vect_prune_runtime_alias_test_list(_loop_vec_info*)
    ../../src-trunk/gcc/tree-vect-data-refs.c:2845
0xb39382 vect_analyze_loop_2
    ../../src-trunk/gcc/tree-vect-loop.c:1716
0xb39382 vect_analyze_loop(loop*)
    ../../src-trunk/gcc/tree-vect-loop.c:1807
0xb4f78f vectorize_loops()
    ../../src-trunk/gcc/tree-vectorizer.c:360
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
specmake[3]: *** [costab.o] Error 1
specmake[3]: *** Waiting for unfinished jobs....

Will this patch fix them?
Cong Hou - Nov. 8, 2013, 9:08 p.m.
Yes, I think so. The bug is that the arguments of
tree_int_cst_compare() may not be constant integers. This patch should
take care of it.



thanks,
Cong


On Fri, Nov 8, 2013 at 12:06 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Nov 8, 2013 at 10:34 AM, Cong Hou <congh@google.com> wrote:
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59050
>>
>> This is my bad. I forget to check the test result for gfortran. With
>> this patch the bug should be fixed (tested on x86-64).
>>
>>
>> thanks,
>> Cong
>>
>>
>> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
>> index 90b01f2..e62c672 100644
>> --- a/gcc/ChangeLog
>> +++ b/gcc/ChangeLog
>> @@ -1,3 +1,8 @@
>> +2013-11-08  Cong Hou  <congh@google.com>
>> +
>> +       PR tree-optimization/59050
>> +       * tree-vect-data-refs.c (comp_dr_addr_with_seg_len_pair): Bug fix.
>> +
>
> Many SPEC CPU 2000 tests failed with
>
> costab.c: In function 'HandleCoinc2':
> costab.c:1565:17: internal compiler error: tree check: expected
> integer_cst, have plus_expr in tree_int_cst_lt, at tree.c:7083
>  void            HandleCoinc2 ( cos1, cos2, hdfactor )
>                  ^
> 0xb6e084 tree_check_failed(tree_node const*, char const*, int, char const*, ...)
>     ../../src-trunk/gcc/tree.c:9477
> 0xb6ffe4 tree_check
>     ../../src-trunk/gcc/tree.h:2914
> 0xb6ffe4 tree_int_cst_lt(tree_node const*, tree_node const*)
>     ../../src-trunk/gcc/tree.c:7083
> 0xb70020 tree_int_cst_compare(tree_node const*, tree_node const*)
>     ../../src-trunk/gcc/tree.c:7093
> 0xe53f1c comp_dr_addr_with_seg_len_pair
>     ../../src-trunk/gcc/tree-vect-data-refs.c:2672
> 0xe5cbb5 vec<dr_addr_with_seg_len_pair_t, va_heap,
> vl_embed>::qsort(int (*)(void const*, void const*))
>     ../../src-trunk/gcc/vec.h:941
> 0xe5cbb5 vec<dr_addr_with_seg_len_pair_t, va_heap, vl_ptr>::qsort(int
> (*)(void const*, void const*))
>     ../../src-trunk/gcc/vec.h:1620
> 0xe5cbb5 vect_prune_runtime_alias_test_list(_loop_vec_info*)
>     ../../src-trunk/gcc/tree-vect-data-refs.c:2845
> 0xb39382 vect_analyze_loop_2
>     ../../src-trunk/gcc/tree-vect-loop.c:1716
> 0xb39382 vect_analyze_loop(loop*)
>     ../../src-trunk/gcc/tree-vect-loop.c:1807
> 0xb4f78f vectorize_loops()
>     ../../src-trunk/gcc/tree-vectorizer.c:360
> Please submit a full bug report,
> with preprocessed source if appropriate.
> Please include the complete backtrace with any bug report.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> specmake[3]: *** [costab.o] Error 1
> specmake[3]: *** Waiting for unfinished jobs....
>
> Will this patch fix them?
>
>
> --
> H.J.
Richard Guenther - Nov. 11, 2013, 9:32 a.m.
On Fri, 8 Nov 2013, Cong Hou wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59050
> 
> This is my bad. I forget to check the test result for gfortran. With
> this patch the bug should be fixed (tested on x86-64).

Ok.

Btw, requirements are to bootstrap and test with all default
languages enabled (that is, without any --enable-languages or
--enable-languages=all).  That
gets you c,c++,objc,java,fortran,lto and misses obj-c++ ada and go.
I am personally using --enable-languages=all,ada,obj-c++.

Thanks,
Richard.

> thanks,
> Cong
> 
> 
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index 90b01f2..e62c672 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,3 +1,8 @@
> +2013-11-08  Cong Hou  <congh@google.com>
> +
> +       PR tree-optimization/59050
> +       * tree-vect-data-refs.c (comp_dr_addr_with_seg_len_pair): Bug fix.
> +
>  2013-11-07  Cong Hou  <congh@google.com>
> 
>         * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks):
> diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
> index b2a31b1..b7eb926 100644
> --- a/gcc/tree-vect-data-refs.c
> +++ b/gcc/tree-vect-data-refs.c
> @@ -2669,9 +2669,9 @@ comp_dr_addr_with_seg_len_pair (const void *p1_,
> const void *p2_)
>        if (comp_res != 0)
>         return comp_res;
>      }
> -  if (tree_int_cst_compare (p11.offset, p21.offset) < 0)
> +  else if (tree_int_cst_compare (p11.offset, p21.offset) < 0)
>      return -1;
> -  if (tree_int_cst_compare (p11.offset, p21.offset) > 0)
> +  else if (tree_int_cst_compare (p11.offset, p21.offset) > 0)
>      return 1;
>    if (TREE_CODE (p12.offset) != INTEGER_CST
>        || TREE_CODE (p22.offset) != INTEGER_CST)
> @@ -2680,9 +2680,9 @@ comp_dr_addr_with_seg_len_pair (const void *p1_,
> const void *p2_)
>        if (comp_res != 0)
>         return comp_res;
>      }
> -  if (tree_int_cst_compare (p12.offset, p22.offset) < 0)
> +  else if (tree_int_cst_compare (p12.offset, p22.offset) < 0)
>      return -1;
> -  if (tree_int_cst_compare (p12.offset, p22.offset) > 0)
> +  else if (tree_int_cst_compare (p12.offset, p22.offset) > 0)
>      return 1;
> 
>    return 0;
> 
>
Jeff Law - Nov. 11, 2013, 6:32 p.m.
On 11/11/13 02:32, Richard Biener wrote:
> On Fri, 8 Nov 2013, Cong Hou wrote:
>
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59050
>>
>> This is my bad. I forget to check the test result for gfortran. With
>> this patch the bug should be fixed (tested on x86-64).
>
> Ok.
>
> Btw, requirements are to bootstrap and test with all default
> languages enabled (that is, without any --enable-languages or
> --enable-languages=all).  That
> gets you c,c++,objc,java,fortran,lto and misses obj-c++ ada and go.
> I am personally using --enable-languages=all,ada,obj-c++.
FWIW, I bootstrapped with Cong's patch to keep my own test results 
clean.  So it's already been through those tests.

If Cong doesn't get to it soon, I'll check it in myself.

jeff
Cong Hou - Nov. 11, 2013, 7:05 p.m.
Hi Jeff

I have committed the fix. Please update your repo.

Thank you!


Cong



On Mon, Nov 11, 2013 at 10:32 AM, Jeff Law <law@redhat.com> wrote:
> On 11/11/13 02:32, Richard Biener wrote:
>>
>> On Fri, 8 Nov 2013, Cong Hou wrote:
>>
>>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59050
>>>
>>> This is my bad. I forget to check the test result for gfortran. With
>>> this patch the bug should be fixed (tested on x86-64).
>>
>>
>> Ok.
>>
>> Btw, requirements are to bootstrap and test with all default
>> languages enabled (that is, without any --enable-languages or
>> --enable-languages=all).  That
>> gets you c,c++,objc,java,fortran,lto and misses obj-c++ ada and go.
>> I am personally using --enable-languages=all,ada,obj-c++.
>
> FWIW, I bootstrapped with Cong's patch to keep my own test results clean.
> So it's already been through those tests.
>
> If Cong doesn't get to it soon, I'll check it in myself.
>
> jeff
>
Cong Hou - Nov. 11, 2013, 7:05 p.m.
Thank you for your advice! I will follow this instruction in future.


thanks,
Cong


On Mon, Nov 11, 2013 at 1:32 AM, Richard Biener <rguenther@suse.de> wrote:
> On Fri, 8 Nov 2013, Cong Hou wrote:
>
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59050
>>
>> This is my bad. I forget to check the test result for gfortran. With
>> this patch the bug should be fixed (tested on x86-64).
>
> Ok.
>
> Btw, requirements are to bootstrap and test with all default
> languages enabled (that is, without any --enable-languages or
> --enable-languages=all).  That
> gets you c,c++,objc,java,fortran,lto and misses obj-c++ ada and go.
> I am personally using --enable-languages=all,ada,obj-c++.
>
> Thanks,
> Richard.
>
>> thanks,
>> Cong
>>
>>
>> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
>> index 90b01f2..e62c672 100644
>> --- a/gcc/ChangeLog
>> +++ b/gcc/ChangeLog
>> @@ -1,3 +1,8 @@
>> +2013-11-08  Cong Hou  <congh@google.com>
>> +
>> +       PR tree-optimization/59050
>> +       * tree-vect-data-refs.c (comp_dr_addr_with_seg_len_pair): Bug fix.
>> +
>>  2013-11-07  Cong Hou  <congh@google.com>
>>
>>         * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks):
>> diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
>> index b2a31b1..b7eb926 100644
>> --- a/gcc/tree-vect-data-refs.c
>> +++ b/gcc/tree-vect-data-refs.c
>> @@ -2669,9 +2669,9 @@ comp_dr_addr_with_seg_len_pair (const void *p1_,
>> const void *p2_)
>>        if (comp_res != 0)
>>         return comp_res;
>>      }
>> -  if (tree_int_cst_compare (p11.offset, p21.offset) < 0)
>> +  else if (tree_int_cst_compare (p11.offset, p21.offset) < 0)
>>      return -1;
>> -  if (tree_int_cst_compare (p11.offset, p21.offset) > 0)
>> +  else if (tree_int_cst_compare (p11.offset, p21.offset) > 0)
>>      return 1;
>>    if (TREE_CODE (p12.offset) != INTEGER_CST
>>        || TREE_CODE (p22.offset) != INTEGER_CST)
>> @@ -2680,9 +2680,9 @@ comp_dr_addr_with_seg_len_pair (const void *p1_,
>> const void *p2_)
>>        if (comp_res != 0)
>>         return comp_res;
>>      }
>> -  if (tree_int_cst_compare (p12.offset, p22.offset) < 0)
>> +  else if (tree_int_cst_compare (p12.offset, p22.offset) < 0)
>>      return -1;
>> -  if (tree_int_cst_compare (p12.offset, p22.offset) > 0)
>> +  else if (tree_int_cst_compare (p12.offset, p22.offset) > 0)
>>      return 1;
>>
>>    return 0;
>>
>>
>
> --
> Richard Biener <rguenther@suse.de>
> SUSE / SUSE Labs
> SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
> GF: Jeff Hawn, Jennifer Guild, Felix Imend

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 90b01f2..e62c672 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@ 
+2013-11-08  Cong Hou  <congh@google.com>
+
+       PR tree-optimization/59050
+       * tree-vect-data-refs.c (comp_dr_addr_with_seg_len_pair): Bug fix.
+
 2013-11-07  Cong Hou  <congh@google.com>

        * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks):
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index b2a31b1..b7eb926 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -2669,9 +2669,9 @@  comp_dr_addr_with_seg_len_pair (const void *p1_,
const void *p2_)
       if (comp_res != 0)
        return comp_res;
     }
-  if (tree_int_cst_compare (p11.offset, p21.offset) < 0)
+  else if (tree_int_cst_compare (p11.offset, p21.offset) < 0)
     return -1;
-  if (tree_int_cst_compare (p11.offset, p21.offset) > 0)
+  else if (tree_int_cst_compare (p11.offset, p21.offset) > 0)
     return 1;
   if (TREE_CODE (p12.offset) != INTEGER_CST