CVS commit: src/external/gpl3/gcc.old/dist/gcc/config/i386

2017-07-28 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Jul 28 22:24:27 UTC 2017

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/i386: i386.c

Log Message:
Apply upstream patch:
Incorrect codegen from rdseed intrinsic use (CVE-2017-11671)

We should not expand call arguments in between flags reg setting and
flags reg using instructions, as it may expand with flags reg
clobbering insn (ADD in this case).

Attached patch moves expansion out of the link. Also, change
zero-extension to non-flags reg clobbering sequence in case we perform
zero-extension with and.

2017-03-25  Uros Bizjak


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c
diff -u src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c:1.6 src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c:1.7
--- src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c:1.6	Sun Jul 23 01:11:06 2017
+++ src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c	Fri Jul 28 22:24:27 2017
@@ -39529,9 +39529,6 @@ ix86_expand_builtin (tree exp, rtx targe
   mode0 = DImode;
 
 rdrand_step:
-  op0 = gen_reg_rtx (mode0);
-  emit_insn (GEN_FCN (icode) (op0));
-
   arg0 = CALL_EXPR_ARG (exp, 0);
   op1 = expand_normal (arg0);
   if (!address_operand (op1, VOIDmode))
@@ -39539,6 +39536,10 @@ rdrand_step:
 	  op1 = convert_memory_address (Pmode, op1);
 	  op1 = copy_addr_to_reg (op1);
 	}
+
+  op0 = gen_reg_rtx (mode0);
+  emit_insn (GEN_FCN (icode) (op0));
+
   emit_move_insn (gen_rtx_MEM (mode0, op1), op0);
 
   op1 = gen_reg_rtx (SImode);
@@ -39547,8 +39548,20 @@ rdrand_step:
   /* Emit SImode conditional move.  */
   if (mode0 == HImode)
 	{
-	  op2 = gen_reg_rtx (SImode);
-	  emit_insn (gen_zero_extendhisi2 (op2, op0));
+	  if (TARGET_ZERO_EXTEND_WITH_AND
+	  && optimize_function_for_speed_p (cfun))
+	{
+	  op2 = force_reg (SImode, const0_rtx);
+
+	  emit_insn (gen_movstricthi
+			 (gen_lowpart (HImode, op2), op0));
+	}
+	  else
+	{
+	  op2 = gen_reg_rtx (SImode);
+
+	  emit_insn (gen_zero_extendhisi2 (op2, op0));
+	}
 	}
   else if (mode0 == SImode)
 	op2 = op0;
@@ -39580,9 +39593,6 @@ rdrand_step:
   mode0 = DImode;
 
 rdseed_step:
-  op0 = gen_reg_rtx (mode0);
-  emit_insn (GEN_FCN (icode) (op0));
-
   arg0 = CALL_EXPR_ARG (exp, 0);
   op1 = expand_normal (arg0);
   if (!address_operand (op1, VOIDmode))
@@ -39590,6 +39600,10 @@ rdseed_step:
 	  op1 = convert_memory_address (Pmode, op1);
 	  op1 = copy_addr_to_reg (op1);
 	}
+
+  op0 = gen_reg_rtx (mode0);
+  emit_insn (GEN_FCN (icode) (op0));
+
   emit_move_insn (gen_rtx_MEM (mode0, op1), op0);
 
   op2 = gen_reg_rtx (QImode);



CVS commit: src/external/gpl3/gcc.old/dist/gcc/config/i386

2017-07-28 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Jul 28 22:24:27 UTC 2017

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/i386: i386.c

Log Message:
Apply upstream patch:
Incorrect codegen from rdseed intrinsic use (CVE-2017-11671)

We should not expand call arguments in between flags reg setting and
flags reg using instructions, as it may expand with flags reg
clobbering insn (ADD in this case).

Attached patch moves expansion out of the link. Also, change
zero-extension to non-flags reg clobbering sequence in case we perform
zero-extension with and.

2017-03-25  Uros Bizjak


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc.old/dist/gcc/config/i386

2015-11-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 22 20:47:42 UTC 2015

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/i386: cpuid.h

Log Message:
Fix logic bug where __cpuid gets called when __get_cpuid_max() returns 0.
This happens when __level == 0, from libgcc/config/i386/cpuinfo.c#285.
This breaks early i486 CPUs which don't have cpuid


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc.old/dist/gcc/config/i386

2015-11-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 22 20:47:42 UTC 2015

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/i386: cpuid.h

Log Message:
Fix logic bug where __cpuid gets called when __get_cpuid_max() returns 0.
This happens when __level == 0, from libgcc/config/i386/cpuinfo.c#285.
This breaks early i486 CPUs which don't have cpuid


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h
diff -u src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h:1.3 src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h:1.4
--- src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h:1.3	Tue Sep 22 23:39:14 2015
+++ src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h	Sun Nov 22 15:47:42 2015
@@ -259,8 +259,9 @@ __get_cpuid (unsigned int __level,
 	 unsigned int *__ecx, unsigned int *__edx)
 {
   unsigned int __ext = __level & 0x8000;
+  unsigned int __maxlevel = __get_cpuid_max (__ext, 0);
 
-  if (__get_cpuid_max (__ext, 0) < __level)
+  if (__maxlevel == 0 || __maxlevel < __level)
 return 0;
 
   __cpuid (__level, *__eax, *__ebx, *__ecx, *__edx);



CVS commit: src/external/gpl3/gcc.old/dist/gcc/config/i386

2014-09-15 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Sep 15 16:29:18 UTC 2014

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/i386: pmm_malloc.h

Log Message:
Apply r1.2 from our GCC 4.8 version of the same file:

Kill the throw() on a forward declaration for posix_memalign (it does
not match our base declaration and may cause warnings).


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/pmm_malloc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc.old/dist/gcc/config/i386/pmm_malloc.h
diff -u src/external/gpl3/gcc.old/dist/gcc/config/i386/pmm_malloc.h:1.1.1.1 src/external/gpl3/gcc.old/dist/gcc/config/i386/pmm_malloc.h:1.2
--- src/external/gpl3/gcc.old/dist/gcc/config/i386/pmm_malloc.h:1.1.1.1	Tue Feb 25 18:38:57 2014
+++ src/external/gpl3/gcc.old/dist/gcc/config/i386/pmm_malloc.h	Mon Sep 15 16:29:18 2014
@@ -31,7 +31,7 @@
 #ifndef __cplusplus
 extern int posix_memalign (void **, size_t, size_t);
 #else
-extern C int posix_memalign (void **, size_t, size_t) throw ();
+extern C int posix_memalign (void **, size_t, size_t);
 #endif
 
 static __inline void *



CVS commit: src/external/gpl3/gcc.old/dist/gcc/config/i386

2014-09-15 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Sep 15 16:29:18 UTC 2014

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/i386: pmm_malloc.h

Log Message:
Apply r1.2 from our GCC 4.8 version of the same file:

Kill the throw() on a forward declaration for posix_memalign (it does
not match our base declaration and may cause warnings).


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/pmm_malloc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.