public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/ibuclaw/heads/darwin)] d: Force TYPE_MODE of classes and non-POD structs as BLKmode
@ 2020-12-22 13:40 Iain Buclaw
  0 siblings, 0 replies; only message in thread
From: Iain Buclaw @ 2020-12-22 13:40 UTC (permalink / raw)
  To: gcc-cvs

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

commit a0f42eb291e98e74eefa9a204492af943427fe76
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Tue Dec 22 09:47:22 2020 +0100

    d: Force TYPE_MODE of classes and non-POD structs as BLKmode
    
    Without this being forced, the optimizer could still make decisions that
    require objects of the non-POD types to need a temporary, which would
    result in an ICE during the expand to RTL passes.
    
    gcc/d/ChangeLog:
    
            * types.cc (TypeVisitor::visit (TypeStruct *)): Set TYPE_MODE of all
            non-trivial types as BLKmode.
            (TypeVisitor::visit (TypeClass *)): Likewise.

Diff:
---
 gcc/d/types.cc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/d/types.cc b/gcc/d/types.cc
index 94aa1f6b9b3..acb8c409526 100644
--- a/gcc/d/types.cc
+++ b/gcc/d/types.cc
@@ -964,7 +964,10 @@ public:
     if (!t->sym->isPOD ())
       {
 	for (tree tv = t->ctype; tv != NULL_TREE; tv = TYPE_NEXT_VARIANT (tv))
-	  TREE_ADDRESSABLE (tv) = 1;
+	  {
+	    TREE_ADDRESSABLE (tv) = 1;
+	    SET_TYPE_MODE (tv, BLKmode);
+	  }
       }
   }
 
@@ -999,7 +1002,10 @@ public:
 
     /* Classes only live in memory, so always set the TREE_ADDRESSABLE bit.  */
     for (tree tv = basetype; tv != NULL_TREE; tv = TYPE_NEXT_VARIANT (tv))
-      TREE_ADDRESSABLE (tv) = 1;
+      {
+	TREE_ADDRESSABLE (tv) = 1;
+	SET_TYPE_MODE (tv, BLKmode);
+      }
 
     /* Type is final, there are no derivations.  */
     if (t->sym->storage_class & STCfinal)


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

only message in thread, other threads:[~2020-12-22 13:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22 13:40 [gcc(refs/users/ibuclaw/heads/darwin)] d: Force TYPE_MODE of classes and non-POD structs as BLKmode Iain Buclaw

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