This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] doloop_optimize miscompiles openssl
At 13:57 27.09.00, Michael Hayes wrote:
>Franz Sirl writes:
>
> > Hmm, already lying in bed, it occurred to me that I'm not sure about the
> > exact definition for loop->exit_count. I seem to remember (I can't test
> > right now) that it was set to 3 for the testcase, this would mean the
> main
> > loop exit isn't counted here and I have to compare for >0, not >1.
>
>Unfortunately, some of this is rather ad-hoc and is one of the reasons
>I'm rewriting the loop optimizer to use the CFG. Reading between the
>lines, I assume that loop->exit_count is 3 but
>loop_info->has_multiple-exit_targets is 0 for your testcase?
Yeah, exactly. In the meantime I convinced myself by looking at the usage
of exit_code elsewhere in the compiler and reading the comments in
basic-block.h that I have to compare exit_count against 0. With this patch
I bootstrapped and tested fine. The raw testcase is at
<http://gcc.gnu.org/ml/gccpatches/200009/msg01033.html> (no access to my
home machine right now, sorry), I have converted it to an executable
testcase in the meantime.
> > In the meantime, while browsing the code, I found another suspicious code
> > fragment:
>
><code snipped>
>
> > Do we need to prefer loop->top here too? The comment doesn't specify
> if the
> > initialization is needed on every loop run...
>
> > Maybe the originator of the code should comment on the patches?
>
>It's only needed once before the loop starts.
OK, but shouldn't we use a emit_insn_before in that case? Won't it be
executed multiple times with the current emit_insn_after in cases where
loop->top is 0 na donly loop->start is set?
> > BTW, I will try to turn both testcases in this thread into executable
> > testcases.
>
>This would be useful. I haven't had a chance to look at this thread
>yet; could you post me a simple testcase?
The other testcase is at
<http://gcc.gnu.org/ml/gcc-patches/2000-09/msg00999.html>. I converted this
one into an non-PPC specific executable testcase too. I'll post my current
patch and the executable testcases later today.
Franz.