diff mbox

Fix loop optimization when ZOL is not available in xtensa configuration

Message ID 1419894762-19375-1-git-send-email-jcmvbkbc@gmail.com
State New
Headers show

Commit Message

Max Filippov Dec. 29, 2014, 11:12 p.m. UTC
Currently building gcc for xtensa configuration with XCHAL_HAVE_LOOPS
set to 0 fails with the following error:

  xtensa.c:3952: undefined reference to `reorg_loops(bool, hw_doloop_hooks*)'

Only compile target-specific zero-overhead loop optimization code when
TARGET_LOOPS allows it.

2014-12-30  Max Filippov  <jcmvbkbc@gmail.com>

	* config/xtensa/xtensa.c (hwloop_optimize, hwloop_fail,
	hwloop_pattern_reg, xtensa_doloop_hooks, xtensa_reorg_loops):
	put under #if TARGET_LOOPS guard.
---
 gcc/config/xtensa/xtensa.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

augustine.sterling@gmail.com Jan. 5, 2015, 4:22 p.m. UTC | #1
On Mon, Dec 29, 2014 at 3:12 PM, Max Filippov <jcmvbkbc@gmail.com> wrote:
> Currently building gcc for xtensa configuration with XCHAL_HAVE_LOOPS
> set to 0 fails with the following error:
>
>   xtensa.c:3952: undefined reference to `reorg_loops(bool, hw_doloop_hooks*)'
>
> Only compile target-specific zero-overhead loop optimization code when
> TARGET_LOOPS allows it.
>
> 2014-12-30  Max Filippov  <jcmvbkbc@gmail.com>
>
>         * config/xtensa/xtensa.c (hwloop_optimize, hwloop_fail,
>         hwloop_pattern_reg, xtensa_doloop_hooks, xtensa_reorg_loops):
>         put under #if TARGET_LOOPS guard.

This is OK. Thanks.
Max Filippov Jan. 5, 2015, 10:24 p.m. UTC | #2
On Mon, Jan 5, 2015 at 7:21 PM, augustine.sterling@gmail.com
<augustine.sterling@gmail.com> wrote:
> [Adding Felix]
>
> On Mon, Dec 29, 2014 at 3:12 PM, Max Filippov <jcmvbkbc@gmail.com> wrote:
>>
>> Currently building gcc for xtensa configuration with XCHAL_HAVE_LOOPS
>> set to 0 fails with the following error:
>>
>>   xtensa.c:3952: undefined reference to `reorg_loops(bool,
>> hw_doloop_hooks*)'
>>
>> Only compile target-specific zero-overhead loop optimization code when
>> TARGET_LOOPS allows it.
>>
>> 2014-12-30  Max Filippov  <jcmvbkbc@gmail.com>
>>
>>         * config/xtensa/xtensa.c (hwloop_optimize, hwloop_fail,
>>         hwloop_pattern_reg, xtensa_doloop_hooks, xtensa_reorg_loops):
>>         put under #if TARGET_LOOPS guard.
>
>
> This is OK. Thanks.

Applied to trunk. Thanks!

-- Max
diff mbox

Patch

diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 9cc7675..fadfb3f 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -3766,6 +3766,8 @@  xtensa_invalid_within_doloop (const rtx_insn *insn)
 
 /* Optimize LOOP.  */
 
+#if TARGET_LOOPS
+
 static bool
 hwloop_optimize (hwloop_info loop)
 {
@@ -3951,6 +3953,12 @@  xtensa_reorg_loops (void)
 {
   reorg_loops (false, &xtensa_doloop_hooks);
 }
+#else
+static inline void
+xtensa_reorg_loops (void)
+{
+}
+#endif
 
 /* Implement the TARGET_MACHINE_DEPENDENT_REORG pass.  */