Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error with 'do while' loop on release optimization level (IDFGH-324) #2308

Closed
laszlopataki opened this issue Aug 17, 2018 · 1 comment
Assignees
Labels
Status: In Progress Work is in progress

Comments

@laszlopataki
Copy link

Environment

  • Development Kit: none
  • IDF version: //020ade65
  • Development Env: Make
  • Operating System: Windows

Problem Description

The following error message is returned when I was using a 'do while' loop and have put an array in the test expression.
The problem only exists if I compile on release optimization level.

$ make
...
CC build/main/loop_failure_main.o
C:\msys32\tmp\ccfLtEqO.s: Assembler messages:
C:\msys32\tmp\ccfLtEqO.s:59: Error: unknown opcode or format name 'lsiu'
make[1]: *** [.../esp/esp-idf/make/component_wrapper.mk:286: loop_failure_main.o] Error 1
make: *** [.../esp/esp-idf/make/project.mk:472: component-main-build] Error 2

Expected Behavior

The project successfully builds.

Actual Behavior

The assembler returns error.

Steps to repropduce

  1. Copy the code snippet into an empty project
  2. Set the optimization level to release.
  3. Build with make

Code to reproduce this issue

#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_spi_flash.h"


void app_main()
{
	uint8_t i = 0;
	float sum = 0.0f;
	float samples[64] = {1.0, 2.0, 3.0, 4.0, 5.0};
	do{
		sum += samples[i];
		i++;
		printf("Loop\n");
	}while (i < 64 && samples[i] != 0);
    //It works with while() loop or without the 'samples[i] != 0' expression.
}
@igrr igrr self-assigned this Aug 18, 2018
@igrr igrr added the Status: In Progress Work is in progress label Aug 18, 2018
@FayeY FayeY changed the title Build error with 'do while' loop on release optimization level [TW#25599] Build error with 'do while' loop on release optimization level Aug 20, 2018
@projectgus projectgus changed the title [TW#25599] Build error with 'do while' loop on release optimization level Build error with 'do while' loop on release optimization level (IDFGH-324) Mar 12, 2019
@igrr
Copy link
Member

igrr commented Apr 12, 2019

Preview release of the toolchain which fixes this issue is now available, see https://www.esp32.com/viewtopic.php?f=10&t=7400&p=31257#p41667.

@igrr igrr closed this as completed in ca323fb Jun 10, 2019
trombik pushed a commit to trombik/esp-idf that referenced this issue Aug 9, 2019
Closes espressif#1445 (std::to_string)
Closes espressif#1876 (std::chrono_steady_clock)
Closes espressif#1995 (std::timed_mutex)
Closes espressif#2149 (addr2line)
Closes espressif#2308 (lsiu/lsip)
Closes espressif#2449 (c++17)
Closes espressif#3258 (objdump)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Progress Work is in progress
Projects
None yet
Development

No branches or pull requests

2 participants