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: optimization/7591: function-related struct copy bug


On Sun, Aug 18, 2002 at 12:09:21AM -0700, H. J. Lu wrote:
> On Sun, Aug 18, 2002 at 03:20:09PM +1000, Greg Schafer wrote:
> > On Sat, Aug 17, 2002 at 06:48:00PM -0700, H. J. Lu wrote:
> > > On Sun, Aug 18, 2002 at 09:34:01AM +1000, Greg Schafer wrote:
> > > > Hello there
> > > > 
> > > > I notice that your gcc test results do not fail the test
> > > > gcc.c-torture/execute/20020307-2.c
> > > > but just about everyone else in the world on i686-pc-linux-gnu
> > > > seems to fail that test.
> > > > 
> > > > Do you know the reason for this? Do you use a local patch or something?
> > > > 
> > > 
> > > http://gcc.gnu.org/ml/gcc-patches/2002-07/msg01561.html
> > 
> > Ahhh, thanks. Not only did it fix that test but it also made
> > "gcc.dg/sequence-pt-1.c" pass for me which was failing otherwise.
> > 
> > Unfortunately, It doesn't fix the testcase in Gnats PR 7591 which you
> > pointed out seems to be caused by -maccumulate-outgoing-args in
> > combination with -mcpu=i686
> 
> I think it is unrelated. Jeff, I think your patch
> 
> http://gcc.gnu.org/ml/gcc-patches/1999-02n/msg00379.html
> 
> may be the cause for that bug. The problem is you mark the stack
> slots being used before they are used by the memcpy libcall:
> 
> 1. expand_call calls store_one_arg.
> 2. store_one_arg marks the stack slots used by arg are being used.
> 3. store_one_arg calls emit_push_insn to push arg.
> 4. emit_push_insn calls emit_library_call to copy arg onto stack.
> 5. emit_library_call calls emit_library_call_value_1 to emit memcpy.
> 6. emit_library_call_value_1 finds the stack slots it is supposed
> to fill are used.
> 7. emit_library_call_value_1 does save/restore around memcpy.
> 
> It doesn't work on x86.
> 

I am testing this patch now. I partially reverted Jeff's patch and
move setting stack_usage_map just before expand_expr, which is needed
according to Jeff's orignal message.


H.J.

Attachment: gcc-copy.patch
Description: Text document


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