diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1215863c452..8ac232141a9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-03-30 H.J. Lu + + PR target/38781 + * config/i386/i386.c (classify_argument): Check total size of + structure. + 2009-03-30 Martin Jambor * ipa-prop.h (jump_func_type): Rename IPA_UNKNOWN, IPA_CONST, diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 3dec02f3acd..09a6597b894 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4942,6 +4942,8 @@ classify_argument (enum machine_mode mode, const_tree type, } else { + int pos; + type = TREE_TYPE (field); /* Flexible array member is ignored. */ @@ -4970,13 +4972,10 @@ classify_argument (enum machine_mode mode, const_tree type, + bit_offset) % 256); if (!num) return 0; - for (i = 0; i < num; i++) - { - int pos = - (int_bit_position (field) + (bit_offset % 64)) / 8 / 8; - classes[i + pos] = - merge_classes (subclasses[i], classes[i + pos]); - } + pos = (int_bit_position (field) + (bit_offset % 64)) / 8 / 8; + for (i = 0; i < num && (i + pos) < words; i++) + classes[i + pos] = + merge_classes (subclasses[i], classes[i + pos]); } } }