On 02/29/2016 04:51 AM, Yuri Rumyantsev wrote:
Hi All,

Here is a simple patch for gcc.dg/ifcvt5.c test - detect "6 basic
blocks" string in rtl dump also to accept speculative motion of
else-part of if-stmt before test-part aka IF-CASE-2.

Is it OK for trunk?

ChanageLog:
2016-02-29  Yuri Rumyantsev  <ysrum...@gmail.com>

PR rtl-optimization/69942
gcc/testsuite/ChangeLog:
* gcc.dg/ifcvt5.c: Detect '6 basic blocks' in rtl dump also.
Rather than change the expected output, I think this will do the trick. Essentially by using a generic "word_mode" type we avoid the problems with ports that promote parameters to word sized objects.

I've verified this passes on my sparc cross compiler as well as x86_64 native.

Installed on the trunk.

Thanks,
Jeff

commit 45fc1bd971ef792eaf78a8a316724a6a6d453697
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu Mar 3 00:11:03 2016 +0000

        PR rtl-optimization/69942
        * gcc.dg/ifcvt-5.c: Use "word_mode" rather than "int" to limit the
        effects of argument promotions.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233922 
138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 05c4e95..39fdb64 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
 2016-03-02  Jeff Law  <l...@redhat.com>
 
+       PR rtl-optimization/69942
+       * gcc.dg/ifcvt-5.c: Use "word_mode" rather than "int" to limit the
+       effects of argument promotions.
+
        PR tree-optimization/69987
        * gfortran.dg/pr69987.f90: Use "-w" to avoid failures when the
        target does not support -fprefetch-loop-arrays.
diff --git a/gcc/testsuite/gcc.dg/ifcvt-5.c b/gcc/testsuite/gcc.dg/ifcvt-5.c
index 0b73e54..818099a 100644
--- a/gcc/testsuite/gcc.dg/ifcvt-5.c
+++ b/gcc/testsuite/gcc.dg/ifcvt-5.c
@@ -2,11 +2,14 @@
    parameter would not allow it.  */
 
 /* { dg-options "-fdump-rtl-ce1 -O2 --param max-rtl-if-conversion-insns=1" } */
-int
-foo (int x, int y, int a)
+
+typedef int word __attribute__((mode(word)));
+
+word
+foo (word x, word y, word a)
 {
-  int i = x;
-  int j = y;
+  word i = x;
+  word j = y;
   if (x > y)
     {
       i = a;

Reply via email to