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: Fix g++.dg/tree-ssa/ivopts-1.C for cris-elf


Hello!

> With a recent correction to this test-case, it started failing
> for cris-elf; the "offset:" non-matcher part to be specific.
> Upon inspection, the correction appeared right; my testing is
> done on a 64-bit host, so there'd be 4294967292 (unsigned -4),
> not 0xfffffffc.  A gdb-session exposed a typo in the

This issue was fixed in a latter patch update.

Anyway, this test exposes unoptimal code generation  on i686, where:

<bb 2>:
  ivtmp.24_11 = (unsigned int) &x[1];

<bb 3>:
  # ivtmp.24_9 = PHI <ivtmp.24_10(4), ivtmp.24_11(2)>
  MEM[index: ivtmp.24_9, offset: 0x0fffffffc] = 1;
  ivtmp.24_10 = ivtmp.24_9 + 4;
  D.1715_12 = &x + 20;
  D.1716_32 = (unsigned int) D.1715_12;
  if (ivtmp.24_10 != D.1716_32)
    goto <bb 4>;
  else
    goto <bb 5>;

<bb 4>:
  goto <bb 3>;


However, one would expect something like:

<bb 2>:
  ivtmp.24_11 = (unsigned int) &x;
  D.1715_12 = &x + 16;
  D.1716_32 = (unsigned int) D.1715_12;

<bb 3>:
  # ivtmp.24_9 = PHI <ivtmp.24_10(4), ivtmp.24_11(2)>
  MEM[index: ivtmp.24_9] = 1;
  ivtmp.24_10 = ivtmp.24_9 + 4;
  if (ivtmp.24_10 != D.1716_32)
    goto <bb 4>;
  else
    goto <bb 5>;

<bb 4>:
  goto <bb 3>;


It should be noted, that x86 address_cost update [1] that fixed PR
target/24669 [Loop index variable has offset of 1] didn't fix the PR
that covers above problem (PR target/26726 [-fivopts producing out of
bounds array refs]) and similar PR tree-optimization18219 [bloats code
by 31%].

[1] http://gcc.gnu.org/ml/gcc-patches/2007-07/msg00354.html

Uros.


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