# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../gcc/3.4.3.patch # Copyright (C) 2004 - 2006 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- T2-COPYRIGHT-NOTE-END --- 004-11-02 Jakub Jelinek PR c/18282 * c-common.c (handle_mode_attribute): Allow mode attribute on enums when the mode is integral. --- ./gcc/c-common.c.jj 2004-10-29 15:17:50.000000000 +0200 +++ ./gcc/c-common.c 2004-11-02 22:57:23.824108588 +0100 @@ -4765,6 +4765,15 @@ handle_mode_attribute (tree *node, tree mode); *node = ptr_type; } + else if (TREE_CODE (type) == ENUMERAL_TYPE) + { + if (TREE_CODE (typefm) != INTEGER_TYPE) + { + error ("cannot use mode `%s' for enumeral types", p); + return NULL_TREE; + } + *node = typefm; + } else if (VECTOR_MODE_P (mode) ? TREE_CODE (type) != TREE_CODE (TREE_TYPE (typefm)) : TREE_CODE (type) != TREE_CODE (typefm)) --- ./gcc/testsuite/gcc.c-torture/compile/20041102-1.c.jj 2004-11-02 23:01:42.022223483 +0100 +++ ./gcc/testsuite/gcc.c-torture/compile/20041102-1.c 2004-11-02 23:00:55.000000000 +0100 @@ -0,0 +1,5 @@ +/* PR c/18282 */ +typedef enum { B1 = 1, B2 = 2, B4 = 4, B8 = 8, B16 = 16 } B; + +B __attribute__ ((mode (QI))) bqi; +B __attribute__ ((mode (word))) bword;