Patchwork PATCH to build_zero_cst for c++/53826 (ICE in libstdc++ on alpha)

login
register
mail settings
Submitter Jason Merrill
Date July 3, 2012, 6:01 p.m.
Message ID <4FF33361.9080006@redhat.com>
Download mbox | patch
Permalink /patch/168848/
State New
Headers show

Comments

Jason Merrill - July 3, 2012, 6:01 p.m.
The back end needs to know how to build up a zero in NULLPTR_TYPE for 
writing out an empty CONSTRUCTOR.

Applying to trunk as obvious.

Patch

commit 458655a61c4e175b120c68093db923010d013eba
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Jul 3 13:23:10 2012 -0400

    	PR c++/53826
    	* tree.c (build_zero_cst): Handle NULLPTR_TYPE.

diff --git a/gcc/tree.c b/gcc/tree.c
index 5aa5399..f9942fb 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1640,7 +1640,7 @@  build_zero_cst (tree type)
     {
     case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE:
     case POINTER_TYPE: case REFERENCE_TYPE:
-    case OFFSET_TYPE:
+    case OFFSET_TYPE: case NULLPTR_TYPE:
       return build_int_cst (type, 0);
 
     case REAL_TYPE: