This is the embarrassing dangling-else bug in sparc_compute_frame_size spotted 
by the -Wparentheses warning.  It went unnoticed for 5 years because the block 
of code is actually a no-op (with or without the bug), it would do something 
only if someone wanted to give a try to a totally new ABI for SPARC...

Tested on SPARC/Solaris, applied on all active branches.


2016-04-12  Eric Botcazou  <ebotca...@adacore.com>

        PR target/70630
        * config/sparc/sparc.c (sparc_compute_frame_size): Add parentheses.

-- 
Eric Botcazou
Index: config/sparc/sparc.c
===================================================================
--- config/sparc/sparc.c	(revision 234827)
+++ config/sparc/sparc.c	(working copy)
@@ -4917,13 +4917,18 @@ sparc_compute_frame_size (HOST_WIDE_INT
 
   /* Calculate space needed for global registers.  */
   if (TARGET_ARCH64)
-    for (i = 0; i < 8; i++)
-      if (save_global_or_fp_reg_p (i, 0))
-	n_global_fp_regs += 2;
+    {
+      for (i = 0; i < 8; i++)
+	if (save_global_or_fp_reg_p (i, 0))
+	  n_global_fp_regs += 2;
+    }
   else
-    for (i = 0; i < 8; i += 2)
-      if (save_global_or_fp_reg_p (i, 0) || save_global_or_fp_reg_p (i + 1, 0))
-	n_global_fp_regs += 2;
+    {
+      for (i = 0; i < 8; i += 2)
+	if (save_global_or_fp_reg_p (i, 0)
+	    || save_global_or_fp_reg_p (i + 1, 0))
+	  n_global_fp_regs += 2;
+    }
 
   /* In the flat window model, find out which local and in registers need to
      be saved.  We don't reserve space in the current frame for them as they

Reply via email to