This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, Ada]: tentative fix for Ada comparison failures on sparcand powerpc


Bootstrapped with c,ada on x86-linux, still needs confirmation
that it fixes both PR (thanks to James for the typo-catching).

Ok for mainline once the fix is confirmed?

Laurent

2004-04-22  Laurent GUERBY <laurent@guerby.net>

	PR optimization/14984
	PR optimization/14985
	* trans.c (gigi): Fix non determinism leading to bootstrap
	comparison failures.

Index: trans.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/trans.c,v
retrieving revision 1.52
diff -w -u -r1.52 trans.c
--- trans.c	19 Apr 2004 15:20:14 -0000	1.52
+++ trans.c	22 Apr 2004 18:04:53 -0000
@@ -2112,8 +2112,11 @@
 	for (gnat_temp = First (Elsif_Parts (gnat_node));
 	     Present (gnat_temp); gnat_temp = Next (gnat_temp))
 	  {
-	    tree gnu_elseif
-	      = build_nt (IF_STMT, gnat_to_gnu (Condition (gnat_temp)),
+            tree gnu_cond, gnu_elseif;
+
+            gnu_cond = gnat_to_gnu (Condition (gnat_temp));
+	    gnu_elseif
+	      = build_nt (IF_STMT, gnu_cond,
 			  build_block_stmt (Then_Statements (gnat_temp)),
 			  NULL_TREE, NULL_TREE);
 
@@ -2123,10 +2126,18 @@
 	    gnu_result = gnu_elseif;
 	  }
 
-      gnu_result = build_nt (IF_STMT, gnat_to_gnu (Condition (gnat_node)),
-			     build_block_stmt (Then_Statements (gnat_node)),
+      {
+        tree gnu_cond, then_block, else_block;
+
+        gnu_cond = gnat_to_gnu (Condition (gnat_node));
+        then_block = build_block_stmt (Then_Statements (gnat_node));
+        else_block = build_block_stmt (Else_Statements (gnat_node));
+
+        gnu_result = build_nt (IF_STMT, gnu_cond, 
+  	    		       then_block,
 			     nreverse (gnu_result),
-			     build_block_stmt (Else_Statements (gnat_node)));
+			       else_block);
+      }
       break;
 
     case N_Case_Statement:



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]