[PATCH] PR31677 fixed by passing --param sra-max-structure-size=32

Richard Sandiford rsandifo@nildram.co.uk
Thu Dec 27 12:33:00 GMT 2007

Jack Howarth <howarth@bromo.msbb.uc.edu> writes:
> The attached patch modifies the gcc.dg/memcpy-1.c testcase to
> pass "--param sra-max-structure-size=32" as suggested by Andrew
> Pinksi in the bug report for PR 31677. This changes eliminates
> the memcpy-1.c testsuite failures at -m32 on powerpc-apple-darwin9.
> Okay for gcc trunk?
>                 Jack
> 2007-12-24  Jack Howarth  <howarth@bromo.med.uc.edu>
> 	PR tree-optimization/31677
> 	* gcc.dg/memcpy-1.c: Pass "--param sra-max-structure-size=32".

FWIW, I found the test useful in its current from.  As Janis said,
it failed at one time on mips*-linux-gnu, and it was actually this
test that showed we had a problem with the MIPS cost metrics.
The test passes with the revised (improved?) metrics.

I understand Andrew's argument: this test was added for a new feature of
SRA, so it's reasonable to add whatever options are necessary to force
the feature to trigger.  However, if rewriting memcpy()s of:

    struct a {int a,b,c;} a;

really is a win for a particular target, I think it is useful to check
that we rewrite it at -O2, rather than with a combination of options
that users are very unlikely to try.  We can just skip the test on
targets where it isn't a win.

Is this test failing for PowerPC because we want it to, or because
the heuristics need tweaking?


More information about the Gcc-patches mailing list