+++ /dev/null
---- gcc/gcc/builtins.c (revision 113409)
-+++ gcc/gcc/builtins.c (revision 113410)
-@@ -275,14 +275,28 @@
- case ADDR_EXPR:
- /* See what we are pointing at and look at its alignment. */
- exp = TREE_OPERAND (exp, 0);
-+ inner = max_align;
-+ while (handled_component_p (exp))
-+ {
-+ /* Fields in a structure can be packed, honour DECL_ALIGN
-+ of the FIELD_DECL. For all other references the conservative
-+ alignment is the element type alignment. */
-+ if (TREE_CODE (exp) == COMPONENT_REF)
-+ inner = MIN (inner, DECL_ALIGN (TREE_OPERAND (exp, 1)));
-+ else
-+ inner = MIN (inner, TYPE_ALIGN (TREE_TYPE (exp)));
-+ exp = TREE_OPERAND (exp, 0);
-+ }
- if (TREE_CODE (exp) == FUNCTION_DECL)
- align = FUNCTION_BOUNDARY;
- else if (DECL_P (exp))
-- align = DECL_ALIGN (exp);
-+ align = MIN (inner, DECL_ALIGN (exp));
- #ifdef CONSTANT_ALIGNMENT
- else if (CONSTANT_CLASS_P (exp))
-- align = CONSTANT_ALIGNMENT (exp, align);
-+ align = MIN (inner, (unsigned)CONSTANT_ALIGNMENT (exp, align));
- #endif
-+ else
-+ align = MIN (align, inner);
- return MIN (align, max_align);
-
- default:
+++ /dev/null
---- gcc/gcc/cp/decl.c
-+++ gcc/gcc/cp/decl.c
-@@ -7598,9 +7598,11 @@
- are always static functions. */
- ;
- else
-- type = build_method_type_directly (ctype,
-- TREE_TYPE (type),
-- TYPE_ARG_TYPES (type));
-+ type = (build_method_type_directly
-+ (cp_build_qualified_type (ctype,
-+ quals & ~TYPE_QUAL_RESTRICT),
-+ TREE_TYPE (type),
-+ TYPE_ARG_TYPES (type)));
- }
- else if (declspecs->specs[(int)ds_typedef]
- || COMPLETE_TYPE_P (complete_type (ctype)))
+++ /dev/null
- PR tree-optimization/27364
- * tree-vrp.c (vrp_int_const_binop): Fix detection of overflow from
- multiply expressions.
-
---- gcc-4_1-branch/gcc/tree-vrp.c.orig 2006-02-10 09:46:43.000000000 +0100
-+++ gcc-4_1-branch/gcc/tree-vrp.c 2006-05-02 22:59:17.000000000 +0200
-@@ -1101,17 +1101,39 @@
- if (TYPE_UNSIGNED (TREE_TYPE (val1)))
- {
- int checkz = compare_values (res, val1);
-+ bool overflow = false;
-
- /* Ensure that res = val1 [+*] val2 >= val1
- or that res = val1 - val2 <= val1. */
-- if (((code == PLUS_EXPR || code == MULT_EXPR)
-+ if ((code == PLUS_EXPR
- && !(checkz == 1 || checkz == 0))
- || (code == MINUS_EXPR
- && !(checkz == 0 || checkz == -1)))
- {
-+ overflow = true;
-+ }
-+ /* Checking for multiplication overflow is done by dividing the
-+ output of the multiplication by the first input of the
-+ multiplication. If the result of that division operation is
-+ not equal to the second input of the multiplication, then the
-+ multiplication overflowed. */
-+ else if (code == MULT_EXPR && !integer_zerop (val1))
-+ {
-+ tree tmp = int_const_binop (TRUNC_DIV_EXPR,
-+ TYPE_MAX_VALUE (TREE_TYPE (val1)),
-+ val1, 0);
-+ int check = compare_values (tmp, val2);
-+
-+ if (check != 0)
-+ overflow = true;
-+ }
-+
-+ if (overflow)
-+ {
- res = copy_node (res);
- TREE_OVERFLOW (res) = 1;
- }
-+
- }
- else if (TREE_OVERFLOW (res)
- && !TREE_OVERFLOW (val1)