]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
avr.c (avr_handle_progmem_attribute): Handle TYPE_DECL.
authorMarek Michalkiewicz <marekm@amelek.gda.pl>
Sat, 25 May 2002 22:15:26 +0000 (00:15 +0200)
committerMarek Michalkiewicz <marekm@gcc.gnu.org>
Sat, 25 May 2002 22:15:26 +0000 (22:15 +0000)
* config/avr/avr.c (avr_handle_progmem_attribute): Handle TYPE_DECL.

* config/avr/avr.c (machine_dependent_reorg): Sign extend the
CONST_INT operand to the correct mode after adding 1 to it.

From-SVN: r53877

gcc/ChangeLog
gcc/config/avr/avr.c

index a13a72a00523c82f556261a493eb6bb0693387a9..0a877a4db4cda8d92025864d3e5a21411482adc9 100644 (file)
@@ -1,3 +1,10 @@
+2002-05-25  Marek Michalkiewicz  <marekm@amelek.gda.pl>
+
+       * config/avr/avr.c (avr_handle_progmem_attribute): Handle TYPE_DECL.
+
+       * config/avr/avr.c (machine_dependent_reorg): Sign extend the
+       CONST_INT operand to the correct mode after adding 1 to it.
+
 2002-05-24  Roman Lechtchinsky  <rl@cs.tu-berlin.de>
 
         * config/alpha/unicosmk.h (REAL_VALUE_TO_TARGET_SINGLE,
index 8e64bcb74aaed250e14701aa02ac43bd63a10188..01948c41702b9cfb9d740b842ac66132fd181e32 100644 (file)
@@ -4669,7 +4669,20 @@ avr_handle_progmem_attribute (node, name, args, flags, no_add_attrs)
 {
   if (DECL_P (*node))
     {
-      if (TREE_STATIC (*node) || DECL_EXTERNAL (*node))
+      if (TREE_CODE (*node) == TYPE_DECL)
+       {
+         /* This is really a decl attribute, not a type attribute,
+            but try to handle it for GCC 3.0 backwards compatibility.  */
+
+         tree type = TREE_TYPE (*node);
+         tree attr = tree_cons (name, args, TYPE_ATTRIBUTES (type));
+         tree newtype = build_type_attribute_variant (type, attr);
+
+         TYPE_MAIN_VARIANT (newtype) = TYPE_MAIN_VARIANT (type);
+         TREE_TYPE (*node) = newtype;
+         *no_add_attrs = true;
+        }
+      else if (TREE_STATIC (*node) || DECL_EXTERNAL (*node))
        {
          if (DECL_INITIAL (*node) == NULL_TREE && !DECL_EXTERNAL (*node))
            {
@@ -5051,11 +5064,11 @@ machine_dependent_reorg (first_insn)
                  rtx pat = PATTERN (next);
                  rtx src = SET_SRC (pat);
                  rtx t = XEXP (src,0);
+                 enum machine_mode mode = GET_MODE (XEXP (pattern, 0));
 
-                 if (avr_simplify_comparision_p (GET_MODE (XEXP (pattern,0)),
-                                                 GET_CODE (t), x))
+                 if (avr_simplify_comparision_p (mode, GET_CODE (t), x))
                    {
-                     XEXP (pattern,1) = GEN_INT (INTVAL (x)+1);
+                     XEXP (pattern, 1) = gen_int_mode (INTVAL (x) + 1, mode);
                      PUT_CODE (t, avr_normalize_condition (GET_CODE (t)));
                      INSN_CODE (next) = -1;
                      INSN_CODE (insn) = -1;