[Bug c/20519] [4.0/4.1 regression] completed type not selected properly with typeof
--- Additional Comments From rth at gcc dot gnu dot org 2005-03-30 01:46 --- Fixed. -- What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20519
[Bug c/20519] [4.0/4.1 regression] completed type not selected properly with typeof
--- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-03-30 01:38 --- Subject: Bug 20519 CVSROOT:/cvs/gcc Module name:gcc Branch: gcc-4_0-branch Changes by: [EMAIL PROTECTED] 2005-03-30 01:38:22 Modified files: gcc: ChangeLog c-common.c c-common.h c-decl.c c-tree.h gcc/cp : ChangeLog cp-tree.h decl.c semantics.c typeck2.c Log message: PR c/20519 * c-decl.c (c_finish_incomplete_decl): Update complete_array_type call. (build_compound_literal): Likewise. Propagate decl type into the initializer. (finish_decl): Likewise. Use new return value from complete_array_type for zero sized arrays. (complete_array_type): Move ... * c-common.c (complete_array_type): ... here. Change first argument to pointer-to-type-node. Consistently use sizetype for the index except for zero sized arrays. Detect zero sized arrays for pedantic mode diagnostics. Create a new type node instead of modifying the old node in place. * c-tree.h (complete_array_type): Move decl ... * c-common.h (complete_array_type): ... here. cp/ * decl.c (cp_complete_array_type): Rename from complete_array_type. Use the new complete_array_type in c-common.c. Update all callers. * cp-tree.h (cp_complete_array_type): Update to match. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.90&r2=2.7592.2.91 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.606.2.1&r2=1.606.2.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.277&r2=1.277.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.630.6.1&r2=1.630.6.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.193&r2=1.193.4.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.19&r2=1.4648.2.20 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1106.2.1&r2=1.1106.2.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1371.2.5&r2=1.1371.2.6 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.463.2.1&r2=1.463.2.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.182&r2=1.182.8.1 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20519
[Bug c/20519] [4.0/4.1 regression] completed type not selected properly with typeof
--- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-03-30 01:35 --- Subject: Bug 20519 CVSROOT:/cvs/gcc Module name:gcc Changes by: [EMAIL PROTECTED] 2005-03-30 01:35:16 Modified files: gcc: ChangeLog c-common.c c-common.h c-decl.c c-tree.h gcc/cp : ChangeLog cp-tree.h decl.c semantics.c typeck2.c Log message: PR c/20519 * c-decl.c (c_finish_incomplete_decl): Update complete_array_type call. (build_compound_literal): Likewise. Propagate decl type into the initializer. (finish_decl): Likewise. Use new return value from complete_array_type for zero sized arrays. (complete_array_type): Move ... * c-common.c (complete_array_type): ... here. Change first argument to pointer-to-type-node. Consistently use sizetype for the index except for zero sized arrays. Detect zero sized arrays for pedantic mode diagnostics. Create a new type node instead of modifying the old node in place. * c-tree.h (complete_array_type): Move decl ... * c-common.h (complete_array_type): ... here. cp/ * decl.c (cp_complete_array_type): Rename from complete_array_type. Use the new complete_array_type in c-common.c. Update all callers. * cp-tree.h (cp_complete_array_type): Update to match. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8020&r2=2.8021 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&r1=1.617&r2=1.618 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.h.diff?cvsroot=gcc&r1=1.279&r2=1.280 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.640&r2=1.641 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-tree.h.diff?cvsroot=gcc&r1=1.197&r2=1.198 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4678&r2=1.4679 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.1113&r2=1.1114 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1381&r2=1.1382 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.465&r2=1.466 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&r1=1.182&r2=1.183 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20519
[Bug c/20519] [4.0/4.1 regression] completed type not selected properly with typeof
-- What|Removed |Added AssignedTo|unassigned at gcc dot gnu |rth at gcc dot gnu dot org |dot org | Status|NEW |ASSIGNED Last reconfirmed|2005-03-17 14:49:20 |2005-03-17 22:03:41 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20519
[Bug c/20519] [4.0/4.1 regression] completed type not selected properly with typeof
--- Additional Comments From joseph at codesourcery dot com 2005-03-17 16:25 --- Subject: Re: [4.0/4.1 regression] completed type not selected properly with typeof On Thu, 17 Mar 2005, rth at gcc dot gnu dot org wrote: > Array dimension data gets stripped here: > > c-decl.c:grokdeclarator > 3863 if (!flag_gen_aux_info && (TYPE_QUALS (element_type))) > 3864type = TYPE_MAIN_VARIANT (type); Looks like complete_array_type is broken in that it should complete the unqualified type then build the array of qualified type with the proper TYPE_MAIN_VARIANT. Because my audit was auditing all uses of build_array_type and TYPE_MAIN_VARIANT and complete_array_type is modifying types directly, this didn't get caught. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20519
[Bug c/20519] [4.0/4.1 regression] completed type not selected properly with typeof
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-17 16:20 --- I think this was caused by: http://gcc.gnu.org/ml/gcc-patches/2005-01/msg02180.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20519
[Bug c/20519] [4.0/4.1 regression] completed type not selected properly with typeof
--- Additional Comments From rth at gcc dot gnu dot org 2005-03-17 16:14 --- Array dimension data gets stripped here: c-decl.c:grokdeclarator 3863 if (!flag_gen_aux_info && (TYPE_QUALS (element_type))) 3864type = TYPE_MAIN_VARIANT (type); -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20519
[Bug c/20519] [4.0/4.1 regression] completed type not selected properly with typeof
--- Additional Comments From rth at gcc dot gnu dot org 2005-03-17 14:53 --- Smaller test case with const char foo[] = "libc"; __typeof (foo) bar; though this gives a different diagnostic: z.c:2: warning: array bar assumed to have one element -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20519
[Bug c/20519] [4.0/4.1 regression] completed type not selected properly with typeof
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-17 14:49 --- Confirmed. This started to happen after 2004-12-11 but before 20050225. -- What|Removed |Added CC||pinskia at gcc dot gnu dot ||org Status|UNCONFIRMED |NEW Ever Confirmed||1 Last reconfirmed|-00-00 00:00:00 |2005-03-17 14:49:20 date|| Target Milestone|--- |4.0.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20519