* [PATCH,c++] fix PR objc++/48479, ICE in cxx_mark_addressable
@ 2011-04-07 13:37 Nathan Froyd
2011-04-14 15:15 ` Nathan Froyd
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Froyd @ 2011-04-07 13:37 UTC (permalink / raw)
To: gcc-patches
My recent patch removing DECL_RTL from CONST_DECLs caused regressions in
the ObjC++ testsuite on Darwin targets. The problem is that
DECL_REGISTER was being called on CONST_DECLs; DECL_REGISTER says:
/* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. */
#define DECL_REGISTER(NODE) (DECL_WRTL_CHECK (NODE)->decl_common.decl_flag_0)
Previously, the DECL_WRTL_CHECK was succeeding when given CONST_DECLs;
it no longer does.
The suggested fix is to simply move the CONST_DECL case in
cxx_mark_addressable; since DECL_REGISTER would have always returned
false for CONST_DECLs, there's no change in functionality. Fixing
DECL_REGISTER to accurately reflect its comment would be helpful, but
there are other ICEs to fix if DECL_REGISTER only takes PARM_DECL and
VAR_DECL; I thought it best to submit that as a separate fix, if at all.
Patch was tested on Darwin targets via IainS and Dominique and fixed the
regression. OK to commit?
-Nathan
gcc/cp/
* typeck.c (cxx_mark_addressable) [CONST_DECL]: Mark addressable
and return immediately.
@@ -5373,7 +5373,6 @@ cxx_mark_addressable (tree exp)
|| DECL_EXTERNAL (x));
/* Fall through. */
- case CONST_DECL:
case RESULT_DECL:
if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)
&& !DECL_ARTIFICIAL (x))
@@ -5391,6 +5390,7 @@ cxx_mark_addressable (tree exp)
TREE_ADDRESSABLE (x) = 1;
return true;
+ case CONST_DECL:
case FUNCTION_DECL:
TREE_ADDRESSABLE (x) = 1;
return true;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH,c++] fix PR objc++/48479, ICE in cxx_mark_addressable
2011-04-07 13:37 [PATCH,c++] fix PR objc++/48479, ICE in cxx_mark_addressable Nathan Froyd
@ 2011-04-14 15:15 ` Nathan Froyd
2011-04-14 16:50 ` Jason Merrill
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Froyd @ 2011-04-14 15:15 UTC (permalink / raw)
To: gcc-patches; +Cc: jason
On Thu, Apr 07, 2011 at 09:37:17AM -0400, Nathan Froyd wrote:
> My recent patch removing DECL_RTL from CONST_DECLs caused regressions in
> the ObjC++ testsuite on Darwin targets. The problem is that
> DECL_REGISTER was being called on CONST_DECLs; DECL_REGISTER says:
>
> /* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. */
> #define DECL_REGISTER(NODE) (DECL_WRTL_CHECK (NODE)->decl_common.decl_flag_0)
>
> Previously, the DECL_WRTL_CHECK was succeeding when given CONST_DECLs;
> it no longer does.
>
> The suggested fix is to simply move the CONST_DECL case in
> cxx_mark_addressable; since DECL_REGISTER would have always returned
> false for CONST_DECLs, there's no change in functionality. Fixing
> DECL_REGISTER to accurately reflect its comment would be helpful, but
> there are other ICEs to fix if DECL_REGISTER only takes PARM_DECL and
> VAR_DECL; I thought it best to submit that as a separate fix, if at all.
>
> Patch was tested on Darwin targets via IainS and Dominique and fixed the
> regression. OK to commit?
Ping. http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00548.html
-Nathan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-04-14 16:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-07 13:37 [PATCH,c++] fix PR objc++/48479, ICE in cxx_mark_addressable Nathan Froyd
2011-04-14 15:15 ` Nathan Froyd
2011-04-14 16:50 ` Jason Merrill
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).