> Steve Ellcey wrote:
> > I am investigating a bad code generation bug on the 64 bit HPPA platform
> > with GCC 4.3.0 and would like some help and/or ideas on how to analyze
> > and fix it.  The failing test is the SPEC 2000 GCC benchmark (version
> > 2.7.2.2) and I have been unable to create a smaller test case so far.
> > 
> > What I have found is that if I build GCC from version 127633 (after
> > applying the patch for PR middle-end/33029 so that the build will work)
> > I can build and run the SPEC GCC benchmark.  If I update GCC to version
> > 127634 then the benchmark will abort when it is run.
> > 
> > The difference between those versions is this patch:
> > 
> >     2007-08-19  Andrew Pinski  <[EMAIL PROTECTED]>
> >          PR middle-end/32940
> >          * cfgexpand.c  (expand_one_register_var): Mark pointer
> >          DECL_ARTIFICIAL as REG_POINTER also.
> >          * stmt.c (expand_decl): Likewise.
> > 
> > In the PR report for 32940 there is a pointer to:
> > 
> >     http://gcc.gnu.org/ml/gcc-patches/2004-06/msg00020.html
> > 
> > That patch fixed a bootstrap problem on HPPA and reverting it (which is
> > what the patch for PR 32940 seems to do) seems to be reintroducing the
> > problem that the earlier patch was intended to fix.  While reverting
> > that patch didn't seem to cause bootstrap problems it does seem to cause
> > problems when building the older GCC version that is in SPEC2000.  Any
> > advise on how to proceed from here?
> > 
> > Steve Ellcey
> > [EMAIL PROTECTED]
> 
> I'm well versed with the problems in this area and I'd be very leery of
> Andrew's patch.  There are some thorny issues in this space and I'm
> far from 100% sure that blindly propagating a pointer type into 
> REG_POINTER is always valid, particularly for compiler generated 
> temporaries.
> 
> Can you describe better what you're seeing in the 2.7.2.2 build that's 
> causing problems?
> 
> Jeff

I am having trouble figuring out exactly what change in the generated
code is causing the failure.  The code still compiles but it aborts when
I run the compiled code.  In talking to David Anglin I do think it is a
problem with a base reg and index reg getting mixed up but I can't
put my finger on exactly where.

I have found that this problem does not occur on the ToT sources and
that the problem went away with this patch:

  2008-04-07  Peter Bergner  <[EMAIL PROTECTED]>

       PR middle-end/PR28690
       * rtlanal.c: Update copyright years.
       (commutative_operand_precedence): Give SYMBOL_REF's the same precedence
       as REG_POINTER and MEM_POINTER operands.
       * emit-rtl.c (gen_reg_rtx_and_attrs): New function.
       (set_reg_attrs_from_value): Call mark_reg_pointer as appropriate.
       * rtl.h (gen_reg_rtx_and_attrs): Add prototype for new function.
       * gcse.c: Update copyright years.
       (pre_delete): Call gen_reg_rtx_and_attrs.
       (hoist_code): Likewise.
       (build_store_vectors): Likewise.
       (delete_store): Likewise.
       * loop-invariant.c (move_invariant_reg): Likewise.
       Update copyright years.

I don't know if porting this patch to the 4.3 branch is an option or not
but it might be the easiest way to fix this problem without having to
revert Andrew's patch.

Steve Ellcey
[EMAIL PROTECTED]

Reply via email to