This is the mail archive of the gcc@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]

Re: GCC 3.3 Prelease broken on s390


Mark Mitchell wrote:

> That seems fine, if it will work.  The key criteria are:
> 
> (1) You can do it in such a way that it's obvious it doesn't affect
> other platforms.
> 
> (2) You can do it quickly.
> 
> Engineering beauty is not a consideration at all, in this case.  

I can offer the following patch, which passes bootstrap/regtest
on s390-ibm-linux and s390x-ibm-linux and restores both targets
to their previous behaviour in all cases, including that Java
leaf-function test case.  See:
http://gcc.gnu.org/ml/gcc-testresults/2003-05/msg00428.html
http://gcc.gnu.org/ml/gcc-testresults/2003-05/msg00429.html


It should be obvious that it does not affect other platforms;
the hunk in uw_update_context_1 is under #ifdef, and the hunk
in uw_init_context_1 does not affect non-s390 platforms because
for them uw_update_context_1 will immediately undo that change
(never mind that even if it didn't, the change would in fact
be correct for other platforms as well).

I will continue to work on a cleaner solution, but I cannot
guarantee that this will succeed within 24 hours (and I'd
also like to ask for Richard's opinion).  

Do you think we should use the patch below for 3.3?

Bye,
Ulrich


	PR other/10650
	* unwind-dw2.c (uw_update_context_1): Don't set sp as cfa on s390.
	(uw_init_context_1): Set initial sp to outer cfa.

Index: gcc/unwind-dw2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind-dw2.c,v
retrieving revision 1.22.2.4
diff -c -p -r1.22.2.4 unwind-dw2.c
*** gcc/unwind-dw2.c	5 May 2003 16:59:21 -0000	1.22.2.4
--- gcc/unwind-dw2.c	7 May 2003 14:54:10 -0000
*************** uw_update_context_1 (struct _Unwind_Cont
*** 1062,1069 ****
--- 1062,1071 ----
       Given that other unwind mechanisms generally won't work if you try
       to represent stack pointer saves and restores directly, we don't
       bother conditionalizing this at all.  */
+ #ifndef __s390__
    tmp_sp = (_Unwind_Ptr) context->cfa;
    orig_context.reg[__builtin_dwarf_sp_column ()] = &tmp_sp;
+ #endif
  
    /* Compute this frame's CFA.  */
    switch (fs->cfa_how)
*************** uw_init_context_1 (struct _Unwind_Contex
*** 1164,1169 ****
--- 1166,1172 ----
  
    /* Force the frame state to use the known cfa value.  */
    context->cfa = outer_cfa;
+   context->reg[__builtin_dwarf_sp_column ()] = &outer_cfa;
    fs.cfa_how = CFA_REG_OFFSET;
    fs.cfa_reg = __builtin_dwarf_sp_column ();
    fs.cfa_offset = 0;


-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


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