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: [tree-ssa] More jump threading improvements


In message <20040127085245.GA3236@gauvain.u-strasbg.fr>, Pop Sebastian writes:
 >My apologies, the generated code is correct.  Next time I will report
 >a bug, I will write a testcase before going further.
 >
 >On Mon, Jan 26, 2004 at 12:17:34PM -0700, law@redhat.com wrote:
 >> 
 >> Apparently your claim is that the values for "a" at some point is wrong.
 >> Why don't you post a testcase which actually tests the value of "a" at
 >> a suitable point and aborts if it is incorrect.
 >> 
 >I have tried several tests like the following and they all passed.
If the worst thing that happens in a day is that we have a false bug
report, then it's been a pretty good day :-)



 >int main(void) 
 >{ 
 >  int a = 0; 
 >  int b; 
 >  while (a < 50) 
 >    { 
 >      for (b = 0; b < 10; b++) 
 >        { 
 >          a++;
 >        } 
 >      a++;
 >    }
 >  if (a != 55)
 >   abort ();
FWIW, what I tried was a dumb printf after the second increment
to verify that "a" was 11, 22, 33, 44, 55 after that second increment.

Note that if/when we have loop information in the dominator optimizer, we
would probably avoid this transformation when the two statements were
at different loop nests simply because it's unlikely to be profitable in
that case.

Jeff


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