Commit 4c7c0c70 by Andrew Pinski Committed by Andrew Pinski

re PR middle-end/17407 (ICE in int_mode_for_mode)

2004-10-25  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/17407
        * c-decl.c (grokdeclarator) <case cdk_array>: Remove the call
        layout_type as it is already done by build_array_type.
        * tree.c (build_array_type): Layout the type even

2004-10-25  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/18121
        * decl.c (grokdeclarator) <case cdk_array>: Remove the call
        layout_type as it is already done by create_array_type_for_decl.

2004-10-25  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/17407
        * gcc.c-torture/compile/pr17407.c: New test.

        PR c++/18121
        * g++.dg/template/array8.C: New test.

From-SVN: r89533
parent d87bdb13
2004-10-25 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/17407
* c-decl.c (grokdeclarator) <case cdk_array>: Remove the call
layout_type as it is already done by build_array_type.
* tree.c (build_array_type): Layout the type even
2004-10-25 Alexandre Oliva <aoliva@redhat.com>
* config/frv/linux.h (TARGET_C99_FUNCTIONS): Define to 0.
......
......@@ -4133,14 +4133,9 @@ grokdeclarator (const struct c_declarator *declarator,
zero. */
if (size && integer_zerop (size))
{
layout_type (type);
TYPE_SIZE (type) = bitsize_zero_node;
TYPE_SIZE_UNIT (type) = size_zero_node;
}
else if (declarator->kind == cdk_pointer)
/* We can never complete an array type which is the
target of a pointer, so go ahead and lay it out. */
layout_type (type);
if (decl_context != PARM
&& (array_ptr_quals != TYPE_UNQUALIFIED
......
2004-10-25 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/18121
* decl.c (grokdeclarator) <case cdk_array>: Remove the call
layout_type as it is already done by create_array_type_for_decl.
2004-10-22 Nathan Sidwell <nathan@codesourcery.com>
PR c++/18095
......
......@@ -7214,13 +7214,6 @@ grokdeclarator (const cp_declarator *declarator,
case cdk_array:
type = create_array_type_for_decl (dname, type,
declarator->u.array.bounds);
if (inner_declarator
&& (inner_declarator->kind == cdk_pointer
|| inner_declarator->kind == cdk_reference
|| inner_declarator->kind == cdk_ptrmem))
/* We can never complete an array type which is the
target of a pointer, so go ahead and lay it out. */
layout_type (type);
break;
case cdk_function:
......
2004-10-25 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/17407
* gcc.c-torture/compile/pr17407.c: New test.
PR c++/18121
* g++.dg/template/array8.C: New test.
2004-10-25 Eric Botcazou <ebotcazou@libertysurf.fr>
PR other/18138
......
// PR c++/18121
// We were trying to layout the array
// type but since the type/value of A<N>::i
// was not known at template declation type,
// we were crashing
template<int> struct A
{
static int const i = 1;
};
template<int N> struct B
{
typedef int (*p)[A<N>::i];
};
typedef struct libxml_xpathCallback {
void *ns_uri;
} libxml_xpathCallback;
typedef libxml_xpathCallback libxml_xpathCallbackArray[];
libxml_xpathCallbackArray *libxml_xpathCallbacks;
void foo1(void);
void
foo (void)
{
if ((*libxml_xpathCallbacks)[3].ns_uri != ((void *)0)) foo1();
}
......@@ -4333,9 +4333,12 @@ build_array_type (tree elt_type, tree index_type)
t = make_node (ARRAY_TYPE);
TREE_TYPE (t) = elt_type;
TYPE_DOMAIN (t) = index_type;
if (index_type == 0)
return t;
{
layout_type (t);
return t;
}
hashcode = iterative_hash_object (TYPE_HASH (elt_type), hashcode);
hashcode = iterative_hash_object (TYPE_HASH (index_type), hashcode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment