Commit files forgotten in r242966.
authorPitchumani Sivanupandi <pitchumani.sivanupandi@microchip.com>
Wed, 30 Nov 2016 15:07:37 +0000 (15:07 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Wed, 30 Nov 2016 15:07:37 +0000 (15:07 +0000)
2016-11-30  Pitchumani Sivanupandi  <pitchumani.sivanupandi@microchip.com>

Commit files forgotten in r242966.

* config/avr/avr-arch.h (avr_mcu_t) [flash_size]: New member.
* config/avr/avr-devices.c (avr_mcu_types): Add flash size info.
* config/avr/gen-avr-mmcu-specs.c (print_mcu): Remove hard-coded
prefix check to find wrap-around value, instead use MCU flash size.
For 8k flash devices, update link_pmem_wrap spec string to
add --pmem-wrap-around=8k.
* config/avr/specs.h (LINK_RELAX_SPEC): Move link_pmem_wrap from
here...
(LINK_SPEC): ...to here.

From-SVN: r243033

gcc/ChangeLog
gcc/config/avr/avr-arch.h
gcc/config/avr/avr-devices.c
gcc/config/avr/gen-avr-mmcu-specs.c
gcc/config/avr/specs.h

index 378ffa4..80b1c90 100644 (file)
@@ -1,3 +1,17 @@
+2016-11-30  Pitchumani Sivanupandi  <pitchumani.sivanupandi@microchip.com>
+
+       Commit files forgotten in r242966.
+
+       * config/avr/avr-arch.h (avr_mcu_t) [flash_size]: New member.
+       * config/avr/avr-devices.c (avr_mcu_types): Add flash size info.
+       * config/avr/gen-avr-mmcu-specs.c (print_mcu): Remove hard-coded
+       prefix check to find wrap-around value, instead use MCU flash size.
+       For 8k flash devices, update link_pmem_wrap spec string to
+       add --pmem-wrap-around=8k.
+       * config/avr/specs.h (LINK_RELAX_SPEC): Move link_pmem_wrap from
+       here...
+       (LINK_SPEC): ...to here.
+
 2016-11-30  David Malcolm  <dmalcolm@redhat.com>
 
        PR c/78498
 
 2016-11-29  Pitchumani Sivanupandi <pitchumani.s@atmel.com>
 
-       * config/avr/avr-arch.h (avr_mcu_t): Add flash_size member.
-       * config/avr/avr-devices.c(avr_mcu_types): Add flash size info.
-       * config/avr/avr-mcu.def: Likewise.
-       * config/avr/gen-avr-mmcu-specs.c (print_mcu): Remove hard-coded prefix
-       check to find wrap-around value, instead use MCU flash size. For 8k
-       flash devices, update link_pmem_wrap spec string to add
-       --pmem-wrap-around=8k.
-       * config/avr/specs.h: Remove link_pmem_wrap from LINK_RELAX_SPEC and
-       add to linker specs (LINK_SPEC) directly.
+       * config/avr/avr-mcu.def: (avr_mcu_types): Add flash size info.
 
 2016-11-29  David Malcolm  <dmalcolm@redhat.com>
 
index a740a15..e6a2d75 100644 (file)
@@ -122,6 +122,9 @@ typedef struct
 
   /* Number of 64k segments in the flash.  */
   int n_flash;
+
+  /* Flash size in bytes.  */
+  int flash_size;
 } avr_mcu_t;
 
 /* AVR device specific features.
index 7d13ba4..cef3b9a 100644 (file)
@@ -111,12 +111,12 @@ avr_texinfo[] =
 const avr_mcu_t
 avr_mcu_types[] =
 {
-#define AVR_MCU(NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, N_FLASH)\
-  { NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, N_FLASH },
+#define AVR_MCU(NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, N_FLASH, FLASH_SIZE)\
+  { NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, N_FLASH, FLASH_SIZE },
 #include "avr-mcus.def"
 #undef AVR_MCU
     /* End of list.  */
-  { NULL, ARCH_UNKNOWN, AVR_ISA_NONE, NULL, 0, 0, 0 }
+  { NULL, ARCH_UNKNOWN, AVR_ISA_NONE, NULL, 0, 0, 0, 0 }
 };
 
 
index 9ea987f..ee75b1e 100644 (file)
@@ -215,17 +215,16 @@ print_mcu (const avr_mcu_t *mcu)
   // avr-specific specs for linking / the linker.
 
   int wrap_k =
-    str_prefix_p (mcu->name, "at90usb8") ? 8
-    : str_prefix_p (mcu->name, "atmega16") ? 16
-    : (str_prefix_p (mcu->name, "atmega32")
-       || str_prefix_p (mcu->name, "at90can32")) ? 32
-    : (str_prefix_p (mcu->name, "atmega64")
-       || str_prefix_p (mcu->name, "at90can64")
-       || str_prefix_p (mcu->name, "at90usb64")) ? 64
+    mcu->flash_size == 0x2000 ? 8
+    : mcu->flash_size == 0x4000 ? 16
+    : mcu->flash_size == 0x8000 ? 32
+    : mcu->flash_size == 0x10000 ? 64
     : 0;
 
   fprintf (f, "*link_pmem_wrap:\n");
-  if (wrap_k)
+  if (wrap_k == 8)
+    fprintf (f, "\t%%{!mno-pmem-wrap-around: --pmem-wrap-around=8k}");
+  else if (wrap_k > 8)
     fprintf (f, "\t%%{mpmem-wrap-around: --pmem-wrap-around=%dk}", wrap_k);
   fprintf (f, "\n\n");
 
index 222ad5b..b5fef33 100644 (file)
@@ -58,7 +58,7 @@ along with GCC; see the file COPYING3.  If not see
   "%{mmcu=*:-m%*} "
 
 #define LINK_RELAX_SPEC                         \
-  "%{mrelax:--relax %(link_pmem_wrap)} "
+  "%{mrelax:--relax} "
 
 #undef  LINK_SPEC
 #define LINK_SPEC                               \
@@ -66,6 +66,7 @@ along with GCC; see the file COPYING3.  If not see
   "%(link_data_start) "                         \
   "%(link_text_start) "                         \
   "%(link_relax) "                              \
+  "%(link_pmem_wrap) "                          \
   "%{shared:%eshared is not supported} "
 
 #undef  LIB_SPEC