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]

Re: [PATCH] Fix PR60930


On 04/24/14 10:20, Bill Schmidt wrote:
Hi,

PR60930 exposes an SLSR problem with a fold.  When multiplying two
constants to create a new stride, the result must fit in the stride type
for the computation or the fold is invalid.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no
regressions.  The same patch applies equally to 4.8, 4.9, and trunk.  Is
this ok for trunk (and for 4.8/4.9 after a suitable burn-in period)?

Thanks,
Bill


[gcc]

2014-04-24  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/60930
	* gimple-ssa-strength-reduction.c (create_mul_imm_cand):  Reject
	creating a multiply candidate by folding two constant
	multiplicands when the result overflows.

[gcc/testsuite]

2014-04-24  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/60930
	* gcc.dg/torture/pr60930.c:  New test.
Doesn't the test depend on long long being at least 64 bits?

What we've done for these kinds of tests in the past is:

if (sizeof (whatever) < needed size)
  exit (0);

Another approach would be to use an effective target test and skip the test if the target doesn't have a suitable long long. Look in testsuite/lib/target-supports.exp for the various target characteristics you can test for. If you go this route you'd create pr60930.x which skips the test. There's several examples you can use to guide you.

With the testcase fixed, this is OK.

jeff


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