aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2003-02-10 13:45:54 +0100
committerEric Botcazou <ebotcazou@gcc.gnu.org>2003-02-10 12:45:54 +0000
commitecf92f822777f05e82a0cb8c93232abf24df8318 (patch)
tree8a1d28c03b69fb9ba8205eed11d31cdecbf9221d /gcc/c-decl.c
parentac5e69da5659335b8f8d942b29bd01dc7384b6ad (diff)
downloadgcc-ecf92f822777f05e82a0cb8c93232abf24df8318.zip
gcc-ecf92f822777f05e82a0cb8c93232abf24df8318.tar.gz
gcc-ecf92f822777f05e82a0cb8c93232abf24df8318.tar.bz2
re PR c/7741 (ICE on conflicting types (make_decl_rtl at varasm.c:834))
PR c/7741 * c-decl.c (duplicate_decls): Discard the initializer of the new decl when the types are conflicting. Co-Authored-By: Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de> From-SVN: r62631
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index a543931..01a3587 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1140,6 +1140,12 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
}
}
error_with_decl (olddecl, "previous declaration of `%s'");
+
+ /* This is safer because the initializer might contain references
+ to variables that were declared between olddecl and newdecl. This
+ will make the initializer invalid for olddecl in case it gets
+ assigned to olddecl below. */
+ DECL_INITIAL (newdecl) = 0;
}
/* TLS cannot follow non-TLS declaration. */
else if (TREE_CODE (olddecl) == VAR_DECL && TREE_CODE (newdecl) == VAR_DECL