From: Richard Henderson Date: Fri, 11 Apr 2003 22:44:23 +0000 (-0700) Subject: re PR c++/10202 ([IA64] ICE in int_mode_for_mode, at stor-layout.c) X-Git-Tag: releases/gcc-3.4.0~7357 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ca06cfe69f7f89314603d636b36adeadbb70b56a;p=thirdparty%2Fgcc.git re PR c++/10202 ([IA64] ICE in int_mode_for_mode, at stor-layout.c) PR c++/10202 * expr.c (expand_expr): Use COMPLETE_OR_UNBOUND_ARRAY_TYPE_P not COMPLETE_TYPE_P for re-invoking layout_decl. * g++.dg/expr/incomplete1.C: New. From-SVN: r65484 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ae76043bd310..f24de1b789f6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-04-11 Richard Henderson + + PR c++/10202 + * expr.c (expand_expr): Use COMPLETE_OR_UNBOUND_ARRAY_TYPE_P + not COMPLETE_TYPE_P for re-invoking layout_decl. + 2003-04-11 Simon Law * doc/bugreport.texi: Fix paragraph breaking between sections diff --git a/gcc/expr.c b/gcc/expr.c index caf35cdaf49a..ad8993d3a0ec 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6712,7 +6712,8 @@ expand_expr (exp, target, tmode, modifier) case VAR_DECL: /* If a static var's type was incomplete when the decl was written, but the type is complete now, lay out the decl now. */ - if (DECL_SIZE (exp) == 0 && COMPLETE_TYPE_P (TREE_TYPE (exp)) + if (DECL_SIZE (exp) == 0 + && COMPLETE_OR_UNBOUND_ARRAY_TYPE_P (TREE_TYPE (exp)) && (TREE_STATIC (exp) || DECL_EXTERNAL (exp))) layout_decl (exp, 0); diff --git a/gcc/testsuite/g++.dg/expr/incomplete1.C b/gcc/testsuite/g++.dg/expr/incomplete1.C new file mode 100644 index 000000000000..03e363a3d5a6 --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/incomplete1.C @@ -0,0 +1,14 @@ +// PR 10202 +// { dg-do compile } +// { dg-options -O0 } + +extern struct _smtp_account smtp_accounts[]; +typedef struct _smtp_account { + int flags; +} Smtp_Account; + +void get_smtp_host_info () +{ + if (smtp_accounts[0].flags & 0x01) + get_smtp_host_info(); +}