Patchwork patch to fix PR55150

login
register
mail settings
Submitter Vladimir Makarov
Date Oct. 31, 2012, 6:42 p.m.
Message ID <50917121.1000200@redhat.com>
Download mbox | patch
Permalink /patch/195986/
State New
Headers show

Comments

Vladimir Makarov - Oct. 31, 2012, 6:42 p.m.
The following patch fixes

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55150

   The patch was successfully bootstrapped on x86/x86-64.

   Committed as rev. 193042.

2012-10-31  Vladimir Makarov  <vmakarov@redhat.com>

         PR middle-end/55150
         * lra-constraints.c (lra_constraints): Update debug insn info
         after equivalence change.

2012-10-31  Vladimir Makarov  <vmakarov@redhat.com>

         PR middle-end/55150
         * gcc.dg/pr55150.c: New test.

Patch

Index: lra-constraints.c
===================================================================
--- lra-constraints.c	(revision 193039)
+++ lra-constraints.c	(working copy)
@@ -3343,7 +3343,10 @@  lra_constraints (bool first_p)
 	     pseudo to the equivalent value if necessary.  */
 	  curr_id = lra_get_insn_recog_data (curr_insn);
 	  if (debug_loc_equivalence_change_p (curr_id->operand_loc[0]))
-	    changed_p = true;
+	    {
+	      lra_update_insn_regno_info (curr_insn);
+	      changed_p = true;
+	    }
 	}
       else if (INSN_P (curr_insn))
 	{
Index: testsuite/gcc.dg/pr55150.c
===================================================================
--- testsuite/gcc.dg/pr55150.c	(revision 0)
+++ testsuite/gcc.dg/pr55150.c	(working copy)
@@ -0,0 +1,72 @@ 
+/* PR middle-end/55150 */
+/* { dg-do compile } */
+/* { dg-options "-Os -g" } */
+
+typedef unsigned int KEY_TABLE_TYPE[(272 / 4)];
+  typedef unsigned int u32;
+  typedef unsigned char u8;
+  static const u32 Camellia_SBOX[][256] = {
+  };
+   static const u32 SIGMA[] = {
+    0xa09e667f, 0x3bcc908b, 0xb67ae858, 0x4caa73b2, 0xc6ef372f, 0xe94f82be,     0x54ff53a5, 0xf1d36f1c, 0x10e527fa, 0xde682d1d, 0xb05688c2, 0xb3e6c1fd };
+   int Camellia_Ekeygen (int keyBitLength, const u8 * rawKey, KEY_TABLE_TYPE k) {
+    register u32 s0, s1, s2, s3;
+    k[0] = s0 = (    	 {
+    	 u32 r = *(const u32 *) (rawKey);
+  r;
+ }
+    );
+    k[2] = s2 = (		{
+    	 u32 r = *(const u32 *) (rawKey + 8);
+  r;
+ }
+    );
+    k[3] = s3 = (		{
+    	 u32 r = *(const u32 *) (rawKey + 12);
+  r;
+ }
+    );
+    if (keyBitLength != 128)     {
+        k[8] = s0 = ( 		     {
+  	         u32 r = *(const u32 *) (rawKey + 16);
+  r;
+ }
+        );
+        if (keyBitLength == 192)	{
+  	  k[10] = s2 = ~s0;
+  	    k[11] = s3 = ~s1;
+  	    }
+      }
+    s0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3];
+    if (keyBitLength == 128)     {
+        k[4] = s0, k[5] = s1, k[6] = s2, k[7] = s3;
+      }
+    else     {
+        k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3;
+        s0 ^= k[8], s1 ^= k[9], s2 ^= k[10], s3 ^= k[11];
+        do    {
+  	  register u32 _t0, _t1, _t2, _t3;
+  	    _t0 = s2 ^ ((SIGMA + 10))[0];
+  	      _t3 ^= Camellia_SBOX[3][(_t0 >> 8) & 0xff];
+  	        s1 ^= _t3;
+  		}
+        while (0);
+        do    {
+  	  u32 _t0 = s0 >> (32 - 30);
+  	    s2 = (s2 << 30) | (s3 >> (32 - 30));
+  	      s3 = (s3 << 30) | _t0;
+  	      }
+        while (0);
+        k[40] = s0, k[41] = s1, k[42] = s2, k[43] = s3;
+        k[64] = s1, k[65] = s2, k[66] = s3, k[67] = s0;
+        s0 = k[8], s1 = k[9], s2 = k[10], s3 = k[11];
+        k[36] = s0, k[37] = s1, k[38] = s2, k[39] = s3;
+        s0 = k[12], s1 = k[13], s2 = k[14], s3 = k[15];
+        do   {
+  	  s1 = (s1 << 15) | (s2 >> (32 - 15));
+  	  }
+        while (0);
+        k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3;
+        k[44] = s1, k[45] = s2, k[46] = s3, k[47] = s0;
+      }
+  }