This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc does not unroll loops && does not skip unnecessary if-blocks??????
- To: dittrich at mathematik dot uni-marburg dot de
- Subject: Re: gcc does not unroll loops && does not skip unnecessary if-blocks??????
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Mon, 24 Jan 2000 01:26:53 +0100
- CC: bug-gcc at gnu dot org
- References: <38883D09.CEAC0BBF@mathematik.uni-marburg.de>
> 1.) gcc does not seem to be able to unroll a simple loop!
Thanks for your bug report. Unfortunately, I could not reproduce your
results.
> The compiler does not perform this simple optimization.
In the assembler code, I could not see any traces of the loop.
> Why not?
Well, it does.
> How is that possible?
I believe the compiler keeps floating-point values in the
floating-point registers in the outer loop. For some reason, it needs
an additional register when performing the inlined inner loop; this
might be an optimization artefact. Therefore, it needs to store things
into memory more often, that's why the code is larger and slower.
Please have a look at the section "Reporting Bugs" of the gcc
manual. In this case, concentrating on a single bug would have been
helpful, as would have been inclusion of the assembler output.
Regards,
Martin