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

Submitted by Jason Merrill on July 3, 2012, 6:01 p.m.

Details

Message ID 4FF33361.9080006@redhat.com
State New
Headers show

Commit Message

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 hide | download patch | download mbox

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: