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] Make tree-ssa work (mostly) on sparc-sun-solaris


Hi,

tree-ssa didn't bootstrap on sparc-sun-solaris for quite some time,
at least not for me. This is a set of small patches that makes tree-ssa
bootstrap again and gives decent testresults for c and c++. The
testresults are at http://gcc.gnu.org/ml/gcc-testresults/2004-02/msg01423.html.

Regarding failures in the testsuite:
* The unresolved gcc-testcases are due to me not cleaning the testuite
  directory between several testsuite runs. This is apparently a known
  problem. I've seen all the other gcc-failures before. These are nothing new.
* I didn't investigate the g++-Failures yet. Without the patches bootstrap
  doesn't get that far.
* The libstdc++-failures are due to SUN's libiconv which apparently
  doesn't support UTF8.
* libmudflap just doesn't work currently. The link-failures that I seen
  have been reported for other targets as well.

PRs related to these patches: 13769, 14307, 14197, 14272, 14322

I'll comment on each part of patch.

* The builtins.c and varasm.c patches fix wrong code generation for bcopy/
  memmove. The PR for this is 14197, the audit trail has relevant analysis.
  This is probably not strictly necessary to make bootstrap work again.
  This should probably also go into mainline!
* The calls.c change is already in mainline and tree-ssa will pick this
  up with the next merge. It's needed for bootstrap though. PR 14307
  tracks this issue.
* The except.c change fixes PR 13769. Without this we get an unrecognizable
  insn from in some cases. The PR has a testcase. This should
  probably go into mainline as well.
* The tree-ssa.c change is an addendum to Andrew Macleod's patch for
  PR 14272. See the audit trail there. I'm not sure if this is strictly
  necessary but we'd better err on the safe side.
* The sparc specific change is Andrew Pinski's proposed solution fo
  PR14322. Without this we get unrecognizable insn in 64bit mode.
  According to Andrew Pinski this should go into mainline as well.

    regards   Christian (away from mail starting monday)

Index: builtins.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.152.2.51
diff -u -r1.152.2.51 builtins.c
--- builtins.c	16 Feb 2004 12:35:41 -0000	1.152.2.51
+++ builtins.c	28 Feb 2004 17:32:54 -0000
@@ -7513,9 +7513,13 @@
   STRIP_NOPS (exp);
 
   if (TREE_CODE (exp) == ADDR_EXPR)
-    return decl_readonly_section (TREE_OPERAND (exp, 0), 0);
-  else
-    return false;
+    {
+      enum tree_code code = TREE_CODE (TREE_OPERAND (exp, 0));
+      char ch = TREE_CODE_CLASS (code);
+      if (ch == 'c' || ch == 'd' || code == CONSTRUCTOR)
+        return decl_readonly_section (TREE_OPERAND (exp, 0), 0);
+    }
+  return false;
 }
 
 /* Front-end to the simplify_builtin_XXX routines.
Index: calls.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/calls.c,v
retrieving revision 1.229.2.45
diff -u -r1.229.2.45 calls.c
--- calls.c	19 Feb 2004 09:05:19 -0000	1.229.2.45
+++ calls.c	28 Feb 2004 17:32:54 -0000
@@ -2264,7 +2264,8 @@
 		  || (ACCUMULATE_OUTGOING_ARGS
 		      && stack_arg_under_construction
 		      && structure_value_addr == virtual_outgoing_args_rtx)
-		  ? copy_addr_to_reg (structure_value_addr)
+		  ? copy_addr_to_reg (convert_memory_address 
+				      (Pmode, structure_value_addr))
 		  : structure_value_addr);
 
       actparms
Index: except.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/except.c,v
retrieving revision 1.227.2.24
diff -u -r1.227.2.24 except.c
--- except.c	13 Feb 2004 13:11:23 -0000	1.227.2.24
+++ except.c	28 Feb 2004 17:32:54 -0000
@@ -3202,6 +3202,7 @@
 
   /* Then adjust to find the real return address.  */
 #if defined (RETURN_ADDR_OFFSET)
+  addr = force_reg (Pmode, addr);
   addr = plus_constant (addr, RETURN_ADDR_OFFSET);
 #endif
 
Index: tree-ssa.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.206
diff -u -r1.1.4.206 tree-ssa.c
--- tree-ssa.c	26 Feb 2004 12:59:42 -0000	1.1.4.206
+++ tree-ssa.c	28 Feb 2004 17:32:56 -0000
@@ -2429,7 +2429,7 @@
 	}
 
       /* A VDEF kills any expression using a virtual operand.  */
-      if (NUM_VDEFS (VDEF_OPS (ann)) > 0)
+      if ((NUM_VDEFS (VDEF_OPS (ann)) > 0) || ann->has_volatile_ops)
         kill_virtual_exprs (tab, true);
     }
 }
Index: varasm.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.295.2.46
diff -u -r1.295.2.46 varasm.c
--- varasm.c	19 Feb 2004 09:05:35 -0000	1.295.2.46
+++ varasm.c	28 Feb 2004 17:32:56 -0000
@@ -4603,7 +4603,12 @@
 	ret = SECCAT_RODATA;
     }
   else
-    ret = SECCAT_RODATA;
+    {
+      char ch = TREE_CODE_CLASS (TREE_CODE (decl));
+      if (ch != 'd' && ch != 'c')
+        abort ();
+      ret = SECCAT_RODATA;
+    }
 
   /* There are no read-only thread-local sections.  */
   if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl))
Index: config/sparc/sparc.md
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/sparc/sparc.md,v
retrieving revision 1.175.2.12
diff -u -r1.175.2.12 sparc.md
--- config/sparc/sparc.md	13 Feb 2004 13:13:21 -0000	1.175.2.12
+++ config/sparc/sparc.md	28 Feb 2004 17:33:13 -0000
@@ -1938,7 +1938,7 @@
 (define_insn "movsi_lo_sum_pic"
   [(set (match_operand:SI 0 "register_operand" "=r")
         (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
-                   (unspec:SI [(match_operand:SI 2 "immediate_operand" "in")] UNSPEC_MOVE_PIC)))]
+                   (unspec:SI [(match_operand:SI 2 "" "")] UNSPEC_MOVE_PIC)))]
   "flag_pic"
   "or\t%1, %%lo(%a2), %0")
 
@@ -2240,7 +2240,7 @@
 (define_insn "movdi_lo_sum_pic"
   [(set (match_operand:DI 0 "register_operand" "=r")
         (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
-                   (unspec:DI [(match_operand:DI 2 "immediate_operand" "in")] UNSPEC_MOVE_PIC)))]
+                   (unspec:DI [(match_operand:DI 2 "" "")] UNSPEC_MOVE_PIC)))]
   "TARGET_ARCH64 && flag_pic"
   "or\t%1, %%lo(%a2), %0")
 


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