Перейти к содержанию
    

Keil 5.12

Установил Keil 5.12 (версия компилятора 5.05).

Попросили поправить программу для прибора, и вдруг вылезло совершенно непотребное, не связанное с тем, что изменил. Вернул старую версию программы, и все равно - то же самое. Запаниковал. Помянул незлым тихим словом системы контроля версий, которыми не пользуюсь... Да и не помогли бы они.

К счастью-удивлению, Keil теперь позволяет выбрать версию компилятора. Выбрал предыдущую (5.04 update 2), скомпилировал - работает нормально. Дальнейшие хождения по ... показали, что к непотребному в новом компиляторе приводит комбинация -O3 -Otime. Убрал оптимизацию по времени, работает. Чудеса.

Возможно, что-то поменялось в CMSIS RTOS RTX, возможно, еще где-то. Не знаю.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Возможно, что-то поменялось в CMSIS RTOS RTX, возможно, еще где-то. Не знаю.
Хотел бы и я с такой же уверенностью исключать ошибку в своей программе. Увы, чаще всего причиной оказывается моя ошибка. Если бы тут можно было бы делать ставки, я поставил бы на отсутствие где-нибудь в вашем коде необходимого volatile. Это при условии, что старой версией проект собирается без предупреждений.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Хотел бы и я с такой же уверенностью исключать ошибку в своей программе. Увы, чаще всего причиной оказывается моя ошибка. Если бы тут можно было бы делать ставки, я поставил бы на отсутствие где-нибудь в вашем коде необходимого volatile. Это при условии, что старой версией проект собирается без предупреждений.

Я тоже предполагаю, что косяк у меня. Но найти его в 4000 строк не представляю возможным.

В старой версии компилируется без предупреждений.

Для общей информации покажу Release Note на версию 5.04 (новая версия поставляется девственно чистой, видимо, в следующем выпуске появятся замечания).

Release notes for ARM Compiler 5.04 update 2 (build 82)

Corrections in ARM Compiler 5.04 update 2

Compiler (armcc)

At -O3 -Otime, the compiler could generate incorrect code for a loop containing a post-incremented variable. A pre-increment operation would be generated instead of a post-increment operation, which could cause incorrect loop behavior. This has been fixed.

[sDCOMP-24893]
In certain circumstances the compiler could crash when compiling C++ code with the --protect_stack option. This has been fixed.

[sDCOMP-24747]
When using the inline assembler with a quoted string construct, for example, __asm("MOV a, b");, the preprocessor would preprocess the assembly code inside the string by mistake. This has been fixed.

[sDCOMP-24731]
At -O1 and above, when compiling an integer divide expression for an ARMv7-M target, the compiler could generate incorrect code that may result in a fault when run with trapping of divide by zero enabled. This has been fixed.

[sDCOMP-24730]
If a pointer to a class A, pointing to an object of a class B indirectly derived from A, was cast with dynamic_cast to a class C from which B was also derived and from which A is not derived, then the compiler could incorrectly remove some information from the output object file. This would cause the linker to delete the Run-Time Type Information (RTTI), and would make the dynamic_cast fail with a runtime type check failure. This also applied to references as well as pointers. This has been fixed.

[sDCOMP-24675]
At -O1 and above, the compiler could miscompile a sequence of code in which a variable was incremented by a constant value and was then used in a conditional expression in which it was decremented by the same, constant value. This has been fixed.

[sDCOMP-24655]
In some circumstances, the compiler could generate incorrect code for reading and writing packed long long bitfields. This has been fixed.

[sDCOMP-24526]
In certain situations when compiling for Thumb-2 and involving closely chained comparisons, such as computing abs(x) and immediately comparing it with another value, the compiler could mistakenly generate a SUB instruction rather than a flag setting SUBS instruction. This could result in incorrect behavior. This has been fixed.

[sDCOMP-24520]
If a value was stored in a local variable with an integer type smaller than four bytes using a __strt, __strex, or __swp intrinsic, the compiler could generate code that failed to sign-extend or zero-extend subsequent reads of that variable when required to do so. This has been fixed.

[sDCOMP-24506]
At -O2 and above, in certain situations involving a sequence of loads or stores to a contiguous area of memory, the compiler could generate an LDM, STM, VLDM, or VSTM instruction with an uninitialized or incorrectly initialized base register for part of the sequence. This has been fixed.

[sDCOMP-24493]
At -O2 and above, in some circumstances the compiler could incorrectly transform a CMP instruction followed by an instruction that tests for a MI or PL condition by changing the condition from MI to PL, or vice-versa, and swapping the order of the CMP operands. This would lead to incorrect behavior where the CMP operands are equal, or differ by 0x80000000. This has been fixed.

[sDCOMP-23837]
Linker (armlink)

When linking a program using --rwpi, --ropi, --fpic, --reloc, or the PI or RELOC attributes in the scatter-file, the linker could incorrectly insert two bytes of padding between a veneer and a subsequent scatter-loading handler. When using the --pad option, the padding bytes would be set to the --pad value and this could result in an arbitrary or undefined instruction being executed. This has been fixed.

[sDCOMP-24101]
To generate correct veneers, the linker must first finalize the order of the sections within an execution region. In rare circumstances, when linking a large program, the linker could incorrectly change the order of the sections after veneers had been inserted. If an inline veneer was created for a section that was subsequently moved, incorrect behavior would occur whenever that veneer was called because execution would transfer to a different section than the one that was expected. This has been fixed.

[sDCOMP-24054]
Libraries

When initializing an object of type std::priority_queue using the constructor that takes only Compare and Container arguments, the library code failed to call make_heap. This would result in top returning values in an incorrect order. This has been fixed.

[sDCOMP-23977]
Use of a %*n directive in a scanf-family function would behave the same as %n, instead of doing nothing as C90 requires. This has been fixed.

[sDCOMP-23881]
When the %[ conversion specifier for a scanf-family function fails to match any input characters, the corresponding argument should be unaffected. Instead, the argument would have had '\0' written to its first byte. This has been fixed.

[sDCOMP-23765]

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Гость nill
К счастью-удивлению, Keil теперь позволяет выбрать версию компилятора.

Подскажите, где это делается.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Подскажите, где это делается.

Project / Options for Target / Target / Code Generation / Arm Compiler

Это только в последнем Кейле появилось.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Присоединяйтесь к обсуждению

Вы можете написать сейчас и зарегистрироваться позже. Если у вас есть аккаунт, авторизуйтесь, чтобы опубликовать от имени своего аккаунта.

Гость
Ответить в этой теме...

×   Вставлено с форматированием.   Вставить как обычный текст

  Разрешено использовать не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.

×
×
  • Создать...