This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[AVR] New option -mrelax.
- From: "Anatoly Sokolov" <aesok at post dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Cc: aesok at post dot ru
- Date: Thu, 17 Jan 2008 02:17:48 +0300
- Subject: [AVR] New option -mrelax.
Hi.
This patch add '-mrelax and' and '-mpmem-wrap-around'
switch in to AVR port. We must pass '-relax' and
'-mpmem-wrap-around=XXk' to the linker when '-mrelax' and
'-mpmem-wrap-around' is specified.
2008-01-17 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr.h (LINK_SPEC): Support -mrelax
and -mpmem-wrap-around.
* config/avr/avr.opt (mrelax, mpmem-wrap-around):
Add.
Index: gcc/config/avr/avr.opt
===================================================================
--- gcc/config/avr/avr.opt (revision 131578)
+++ gcc/config/avr/avr.opt (working copy)
@@ -58,3 +58,11 @@
mtiny-stack
Target Report Mask(TINY_STACK)
Change only the low 8 bits of the stack pointer
+
+mrelax
+Target Report
+Relax branches
+
+mpmem-wrap-around
+Target Report
+Make the linker relaxation machine assume that a program
counter wrap-around occures.
Index: gcc/config/avr/avr.h
===================================================================
--- gcc/config/avr/avr.h (revision 131578)
+++ gcc/config/avr/avr.h (working copy)
@@ -737,12 +737,21 @@
#define ASM_SPEC
"%{mmcu=avr25:-mmcu=avr2;mmcu=avr35:-mmcu=avr3;\
mmcu=*:-mmcu=%*}"
-#define LINK_SPEC " %{!mmcu*:-m avr2}\
+#define LINK_SPEC "\
+%{mrelax:--relax\
+
%{mpmem-wrap-around:%{mmcu=at90usb8*:--pmem-wrap-around=8k}\
+
%{mmcu=atmega16*:--pmem-wrap-around=16k}\
+ %{mmcu=atmega32*|\
+
mmcu=at90can32*:--pmem-wrap-around=32k}\
+ %{mmcu=atmega64*|\
+ mmcu=at90can64*|\
+
mmcu=at90usb64*:--pmem-wrap-around=64k}}}\
+%{!mmcu*: -m avr2}\
%{mmcu=at90s1200|\
mmcu=attiny11|\
mmcu=attiny12|\
mmcu=attiny15|\
- mmcu=attiny28:-m avr1}\
+ mmcu=attiny28: -m avr1}\
%{mmcu=attiny22|\
mmcu=attiny26|\
mmcu=at90s2*|\
@@ -756,19 +765,19 @@
mmcu=attiny25|\
mmcu=attiny261|\
mmcu=attiny4*|\
- mmcu=attiny8*:-m avr2}\
+ mmcu=attiny8*: -m avr2}\
%{mmcu=atmega103|\
mmcu=at43*|\
mmcu=at76*|\
mmcu=at90usb82|\
- mmcu=at90usb162:-m avr3}\
+ mmcu=at90usb162: -m avr3}\
%{mmcu=atmega8*|\
mmcu=atmega48*|\
mmcu=at90pwm1|\
mmcu=at90pwm2|\
mmcu=at90pwm2b|\
mmcu=at90pwm3|\
- mmcu=at90pwm3b:-m avr4}\
+ mmcu=at90pwm3b: -m avr4}\
%{mmcu=atmega16*|\
mmcu=atmega32*|\
mmcu=atmega406|\
@@ -779,7 +788,7 @@
mmcu=at90pwm316|\
mmcu=at90usb64*|\
mmcu=at90usb128*|\
- mmcu=at94k:-m avr5}\
+ mmcu=at94k: -m avr5}\
%{mmcu=atmega324*|\
mmcu=atmega325*|\
mmcu=atmega328p|\
Anatoly.