* PATCH: PR c++/37450: [4.4 Regression] C++ FE times out on duplicated parameter
@ 2008-09-14 0:06 H.J. Lu
2008-09-30 20:11 ` Mark Mitchell
0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2008-09-14 0:06 UTC (permalink / raw)
To: gcc-patches
C++ FE times out on g++.old-deja/g++.mike/warn4.C since
pushdecl_maybe_friend returns the old parameter when there is
a duplicate. As the result,
for (; parms; parms = TREE_CHAIN (parms))
becomes an infinite loop since TREE_CHAIN (parms) == parms. This
patch fixes it. OK for trunk?
Thanks.
H.J.
---
2008-09-13 H.J. Lu <hongjiu.lu@intel.com>
PR c++/37450
* name-lookup.c (pushdecl_maybe_friend): Don't return the old
parameter for duplicate.
--- gcc/cp/name-lookup.c.dup 2008-09-08 20:21:40.000000000 -0700
+++ gcc/cp/name-lookup.c 2008-09-13 15:44:01.000000000 -0700
@@ -720,8 +720,9 @@ pushdecl_maybe_friend (tree x, bool is_f
else if (TREE_CODE (t) == PARM_DECL)
{
/* Check for duplicate params. */
- if (duplicate_decls (x, t, is_friend))
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
+ tree d = duplicate_decls (x, t, is_friend);
+ if (d)
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, d);
}
else if ((DECL_EXTERN_C_FUNCTION_P (x)
|| DECL_FUNCTION_TEMPLATE_P (x))
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH: PR c++/37450: [4.4 Regression] C++ FE times out on duplicated parameter
2008-09-14 0:06 PATCH: PR c++/37450: [4.4 Regression] C++ FE times out on duplicated parameter H.J. Lu
@ 2008-09-30 20:11 ` Mark Mitchell
0 siblings, 0 replies; 2+ messages in thread
From: Mark Mitchell @ 2008-09-30 20:11 UTC (permalink / raw)
To: H.J. Lu; +Cc: gcc-patches
H.J. Lu wrote:
> 2008-09-13 H.J. Lu <hongjiu.lu@intel.com>
>
> PR c++/37450
> * name-lookup.c (pushdecl_maybe_friend): Don't return the old
> parameter for duplicate.
OK.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-30 18:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-14 0:06 PATCH: PR c++/37450: [4.4 Regression] C++ FE times out on duplicated parameter H.J. Lu
2008-09-30 20:11 ` Mark Mitchell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).