public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/morello)] varasm: Don't call assemble_integer on NULLPTR_TYPE cst
@ 2022-05-20 12:34 Alex Coplan
  0 siblings, 0 replies; only message in thread
From: Alex Coplan @ 2022-05-20 12:34 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b77e97c4392cc7b10dc598245c3e9eedbed6e4c6

commit b77e97c4392cc7b10dc598245c3e9eedbed6e4c6
Author: Alex Coplan <alex.coplan@arm.com>
Date:   Fri Mar 18 13:27:06 2022 +0000

    varasm: Don't call assemble_integer on NULLPTR_TYPE cst
    
    Fixes an ICE seen with gcc/testsuite/g++.dg/cpp0x/nullptr30.C.
    
    gcc/ChangeLog:
    
            * varasm.c (output_constant): Use assemble_pointer for constants
            of NULLPTR_TYPE.

Diff:
---
 gcc/varasm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/varasm.c b/gcc/varasm.c
index 4ec8ca79205..d680f01690d 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -5219,7 +5219,9 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align,
       cst = expand_expr (exp, NULL_RTX, VOIDmode, EXPAND_INITIALIZER);
       if (reverse)
 	cst = flip_storage_order (TYPE_MODE (TREE_TYPE (exp)), cst);
-      if (!assemble_integer (cst, MIN (size, thissize), align, 0))
+      if (code == NULLPTR_TYPE)
+	assemble_pointer (cst);
+      else if (!assemble_integer (cst, MIN (size, thissize), align, 0))
 	error ("initializer for integer/fixed-point value is too complicated");
       break;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-20 12:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 12:34 [gcc(refs/vendors/ARM/heads/morello)] varasm: Don't call assemble_integer on NULLPTR_TYPE cst Alex Coplan

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).