реклама на сайте
подробности

 
 
> AVR GCC и оптимизация
belen
сообщение Apr 23 2011, 07:24
Сообщение #1





Группа: Новичок
Сообщений: 8
Регистрация: 9-03-09
Пользователь №: 45 861



Как отключить (включить) оптимизацию в WIN AVR выражением препроцессора по аналогии с #pragma opt-/+ в Code Vision?
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
ek74
сообщение Apr 25 2011, 11:55
Сообщение #2


Частый гость
**

Группа: Свой
Сообщений: 81
Регистрация: 4-08-05
Из: г. Саратов
Пользователь №: 7 351



Цитата(gotty @ Apr 24 2011, 12:05) *

Цитата(belen @ Apr 25 2011, 13:05) *
Я работаю с GCC уже не первый год и знаю какие флаги изменяют режим оптимизации, но режим оптимизации прменяется ко всему файлу(ам).

__attribute__ ((optimize("Os")))
Цитата
optimize
The optimize attribute is used to specify that a function is to be compiled with different optimization options than specified on the command line. Arguments can either be numbers or strings. Numbers are assumed to be an optimization level. Strings that begin with O are assumed to be an optimization option, while other options are assumed to be used with a -f prefix. You can also use the `#pragma GCC optimize' pragma to set the optimization options that affect more than one function. See Function Specific Option Pragmas, for details about the `#pragma GCC optimize' pragma.

This can be used for instance to have frequently executed functions compiled with more aggressive optimization options that produce faster and larger code, while other functions can be called with less aggressive options.

Работает с начиная с версии GCC 4.4.
Go to the top of the page
 
+Quote Post
belen
сообщение Apr 28 2011, 09:10
Сообщение #3





Группа: Новичок
Сообщений: 8
Регистрация: 9-03-09
Пользователь №: 45 861



Цитата(ek74 @ Apr 25 2011, 14:55) *
__attribute__ ((optimize("Os")))

Работает с начиная с версии GCC 4.4.


Спасибо ek74. У меня GCC 4.3.3. Надо обновить. Замечательно.
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 20th July 2025 - 05:10
Рейтинг@Mail.ru


Страница сгенерированна за 0.01377 секунд с 7
ELECTRONIX ©2004-2016