avr-libc-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-commit] [2419] bug #40003: cast expression to required destina


From: Pitchumani
Subject: [avr-libc-commit] [2419] bug #40003: cast expression to required destination type to avoid inefficient code by gcc
Date: Mon, 28 Apr 2014 13:36:31 +0000

Revision: 2419
          http://svn.sv.gnu.org/viewvc/?view=rev&root=avr-libc&revision=2419
Author:   pitchumani
Date:     2014-04-28 13:36:30 +0000 (Mon, 28 Apr 2014)
Log Message:
-----------
bug #40003: cast expression to required destination type to avoid inefficient 
code by gcc

Ticket Links:
------------
    http://savannah.gnu.org/bugs/?40003

Modified Paths:
--------------
    trunk/avr-libc/ChangeLog
    trunk/avr-libc/NEWS
    trunk/avr-libc/include/avr/wdt.h

Modified: trunk/avr-libc/ChangeLog
===================================================================
--- trunk/avr-libc/ChangeLog    2014-04-16 11:43:43 UTC (rev 2418)
+++ trunk/avr-libc/ChangeLog    2014-04-28 13:36:30 UTC (rev 2419)
@@ -1,3 +1,8 @@
+2014-04-28  Joey Morin <address@hidden>
+
+       Fix for bug #40003: Integer type promotion leads to inefficent code in 
wdt.h
+       * include/avr/wdt.h (wdt_enable): cast expression to destination type
+
 2014-04-16  Pitchumani Sivanupandi <address@hidden>
 
        Fix for bug #42084: wrong LFUSE_DEFAULT in iotn84a.h

Modified: trunk/avr-libc/NEWS
===================================================================
--- trunk/avr-libc/NEWS 2014-04-16 11:43:43 UTC (rev 2418)
+++ trunk/avr-libc/NEWS 2014-04-28 13:36:30 UTC (rev 2419)
@@ -17,6 +17,7 @@
   [#38135] Install a dummy stdfix-avrlibc.h
   [#38516] Missing TWI and UCSR1D definitions for ATmega16/32 U4
   [#39783] CRC missing definitions and incorrect power macros for xmega D3
+  [#40003] Integer type promotion leads to inefficent code in wdt.h
   [#40567] Invalid names in iotn13a.h (EEPE/EEMPE/BODS/BODSE)
   [#40595] iotn2313a.h: wrong fuses definitions for High Fuse Byte
   [#41519] wrong SPM_PAGESIZE definition in iotn[48]8.h

Modified: trunk/avr-libc/include/avr/wdt.h
===================================================================
--- trunk/avr-libc/include/avr/wdt.h    2014-04-16 11:43:43 UTC (rev 2418)
+++ trunk/avr-libc/include/avr/wdt.h    2014-04-28 13:36:30 UTC (rev 2419)
@@ -333,7 +333,7 @@
     "sts %0,%2" "\n\t" \
     : /* no outputs */  \
     : "M" (_SFR_MEM_ADDR(_WD_CONTROL_REG)), \
-    "r" (_BV(_WD_CHANGE_BIT) | _BV(WDE)), \
+    "r" ((uint8_t)(_BV(_WD_CHANGE_BIT) | _BV(WDE))), \
     "r" ((uint8_t) ((value & 0x08 ? _WD_PS3_MASK : 0x00) | \
         _BV(WDE) | (value & 0x07)) ) \
     : "r0"  \
@@ -368,7 +368,7 @@
         "out %0,%2" \
         : /* no outputs */  \
         : "I" (_SFR_IO_ADDR(_WD_CONTROL_REG)), \
-        "r" (_BV(_WD_CHANGE_BIT) | _BV(WDE)),   \
+        "r" ((uint8_t)(_BV(_WD_CHANGE_BIT) | _BV(WDE))),   \
         "r" ((uint8_t) ((value & 0x08 ? _WD_PS3_MASK : 0x00) | \
             _BV(WDE) | (value & 0x07)) ) \
         : "r0"  \




reply via email to

[Prev in Thread] Current Thread [Next in Thread]