This is the mail archive of the gcc-bugs@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]

Re: gcc does not unroll loops && does not skip unnecessary if-blocks??????


> 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


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