public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Nathan Sidwell <nathan@acm.org>
To: Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PR 79905] ICE with vector_type
Date: Tue, 04 Apr 2017 18:02:00 -0000	[thread overview]
Message-ID: <06e56d03-48eb-10cf-7214-171cd048a1d2@acm.org> (raw)
In-Reply-To: <6FEFB107-4422-4F67-8A66-31D13C277741@linux.vnet.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 242 bytes --]

On 04/04/2017 01:40 PM, Bill Schmidt wrote:
> At first blush, the POC patch breaks every test that uses -flto.  I'll see if I can dig deeper after a bit,
> in case this doesn't make the problem obvious.

Try this.

nathan

-- 
Nathan Sidwell

[-- Attachment #2: 79905-3.diff --]
[-- Type: text/x-patch, Size: 1787 bytes --]

Index: c-family/c-common.c
===================================================================
--- c-family/c-common.c	(revision 246647)
+++ c-family/c-common.c	(working copy)
@@ -7465,7 +7465,8 @@ set_underlying_type (tree x)
 {
   if (x == error_mark_node)
     return;
-  if (DECL_IS_BUILTIN (x) && TREE_CODE (TREE_TYPE (x)) != ARRAY_TYPE)
+  if (DECL_IS_BUILTIN (x) && TYPE_NAME (TREE_TYPE (x)) != error_mark_node
+      && TREE_CODE (TREE_TYPE (x)) != ARRAY_TYPE)
     {
       if (TYPE_NAME (TREE_TYPE (x)) == 0)
 	TYPE_NAME (TREE_TYPE (x)) = x;
Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c	(revision 246647)
+++ config/rs6000/rs6000.c	(working copy)
@@ -17459,9 +17459,28 @@ rs6000_init_builtins (void)
   tdecl = add_builtin_type ("__vector unsigned int", unsigned_V4SI_type_node);
   TYPE_NAME (unsigned_V4SI_type_node) = tdecl;
 
-  tdecl = add_builtin_type ("__vector signed int", V4SI_type_node);
-  TYPE_NAME (V4SI_type_node) = tdecl;
+  { // Ugly POC hack
+    TYPE_NAME (V4SI_type_node) = error_mark_node; // placeholder
+    tdecl = add_builtin_type ("__vector signed int", V4SI_type_node);
+    TYPE_NAME (V4SI_type_node) = NULL_TREE; // restore
 
+    if (tdecl) 
+      {
+	// Ew, change the underlying type
+#if 0
+	DECL_ORIGINAL_TYPE (tdecl) = V4SI_type_node;
+	tree clone = build_variant_type_copy (V4SI_type_node);
+	TYPE_STUB_DECL (clone) = TYPE_STUB_DECL (V4SI_type_node);
+	TYPE_NAME (clone) = tdecl;
+
+	TREE_USED (clone) = 1;
+	TREE_TYPE (tdecl) = clone;
+#endif
+	TREE_USED (TREE_TYPE (tdecl)) = true;
+	V4SI_type_node = TREE_TYPE (tdecl);
+      }
+  }
+  
   tdecl = add_builtin_type ("__vector __bool int", bool_V4SI_type_node);
   TYPE_NAME (bool_V4SI_type_node) = tdecl;
 

  reply	other threads:[~2017-04-04 18:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03 19:03 Nathan Sidwell
2017-04-04  8:28 ` Richard Biener
2017-04-04 11:31   ` Nathan Sidwell
2017-04-04 13:00     ` Richard Biener
2017-04-04 13:49       ` Nathan Sidwell
2017-04-04 13:57         ` Bill Schmidt
2017-04-04 14:02           ` Nathan Sidwell
2017-04-04 17:40             ` Bill Schmidt
2017-04-04 18:02               ` Nathan Sidwell [this message]
2017-04-04 20:46                 ` Bill Schmidt
2017-04-05 13:18                   ` Nathan Sidwell
2017-04-05 13:35                     ` Bill Schmidt
2017-04-05 14:14                       ` Nathan Sidwell
2017-04-05 20:33                         ` Bill Schmidt
2017-04-06 10:29                           ` Richard Biener
2017-04-06 11:28                             ` Nathan Sidwell
2017-04-06 14:04                               ` Richard Biener
2017-04-06 14:20                                 ` Bill Schmidt
2017-04-06 14:26                                   ` Bill Schmidt
2017-04-06 15:13                                     ` Bill Schmidt
2017-04-06 18:34                                       ` Nathan Sidwell
2017-04-06 20:18                                         ` Segher Boessenkool
2017-04-10 11:24                                           ` Nathan Sidwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06e56d03-48eb-10cf-7214-171cd048a1d2@acm.org \
    --to=nathan@acm.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    --cc=wschmidt@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).