OSDN Git Service

Backport from mainline
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Apr 2014 19:05:33 +0000 (19:05 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Apr 2014 19:05:33 +0000 (19:05 +0000)
        2014-04-21  Uros Bizjak  <ubizjak@gmail.com>

        PR target/60909
        * config/i386/i386.c (ix86_expand_builtin)
        <case IX86_BUILTIN_RDRAND{16,32,64}_STEP>: Use temporary
        register for target RTX.

testsuite/ChangeLog:

        Backport from mainline
        2014-04-21  Uros Bizjak  <ubizjak@gmail.com>

        PR target/60909
        * gcc.target/i386/pr60909.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@209718 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr60909.c [new file with mode: 0644]

index 27001a1..153f6ab 100644 (file)
@@ -1,10 +1,20 @@
+2014-04-23  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline
+       2014-04-21  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/60909
+       * config/i386/i386.c (ix86_expand_builtin)
+       <case IX86_BUILTIN_RDRAND{16,32,64}_STEP>: Use temporary
+        register for target RTX.
+
 2014-04-07  Martin Jambor  <mjambor@suse.cz>
 
        PR ipa/60640
        * ipa-cp.c (propagate_constants_accross_call): Do not propagate
        accross thunks.
 
-2014-04-07  Dominique d'Humieres <dominiq@lps.ens.fr>    
+2014-04-07  Dominique d'Humieres <dominiq@lps.ens.fr>
 
        Backport from mainline
        2013-09-14  Iain Sandoe <iains@gcc.gnu.org>
@@ -73,7 +83,7 @@
        double ints throughout.
 
 2014-03-18  Richard Biener  <rguenther@suse.de>
+
        Backport from mainline
        2013-08-27  Richard Biener  <rguenther@suse.de>
 
index 9116dd4..b39ec9d 100644 (file)
@@ -29693,7 +29693,8 @@ rdrand_step:
       else
        op2 = gen_rtx_SUBREG (SImode, op0, 0);
 
-      if (target == 0)
+      if (target == 0
+         || !register_operand (target, SImode))
        target = gen_reg_rtx (SImode);
 
       pat = gen_rtx_GEU (VOIDmode, gen_rtx_REG (CCCmode, FLAGS_REG),
index 25cda77..e9fea10 100644 (file)
@@ -1,8 +1,16 @@
+2014-04-23  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline
+       2014-04-21  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/60909
+       * gcc.target/i386/pr60909.c: New test.
+
 2014-04-12  Jerry DeLisle  <jvdelisle@gcc.gnu>
 
        Backport from mainline
        PR libfortran/60810
-       gfortran.dg/arrayio_13.f90: New test.
+       gfortran.dg/arrayio_13.f90: New test.
 
 2014-04-07  Martin Jambor  <mjambor@suse.cz>
 
diff --git a/gcc/testsuite/gcc.target/i386/pr60909.c b/gcc/testsuite/gcc.target/i386/pr60909.c
new file mode 100644 (file)
index 0000000..5a1ac3c
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-mrdrnd" } */
+
+extern void bar (int);
+
+void
+foo (unsigned *u)
+{
+  int i = __builtin_ia32_rdrand32_step (u);
+  bar (i);
+}