public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/vendors/redhat/heads/gcc-8-branch)] re PR tree-optimization/86159 (g++ ICE at -O1 and above on valid code: incorrect type of vector CONS
Date: Fri, 14 May 2021 14:56:27 +0000 (GMT)	[thread overview]
Message-ID: <20210514145627.7EDBC3951815@sourceware.org> (raw)

https://gcc.gnu.org/g:5236c5f5f89e867433e3083c02849ea4cba54ee4

commit 5236c5f5f89e867433e3083c02849ea4cba54ee4
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Jun 15 11:08:30 2018 +0000

    re PR tree-optimization/86159 (g++ ICE at -O1 and above on valid code: incorrect type of vector CONSTRUCTOR elements)
    
    2018-06-15  Richard Biener  <rguenther@suse.de>
    
            PR middle-end/86159
            * tree-cfg.c (gimplify_build3): Do not strip sign conversions,
            leave useless conversion stripping to force_gimple_operand_gsi.
            (gimplify_build2): Likewise.
            (gimplify_build1): Likewise.
    
            * g++.dg/pr86159.C: New testcase.
    
    (cherry picked from commit fa6852317327d978d4069175952109505204f6ae)

Diff:
---
 gcc/testsuite/g++.dg/pr86159.C | 10 ++++++++++
 gcc/tree-cfg.c                 |  6 ------
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/gcc/testsuite/g++.dg/pr86159.C b/gcc/testsuite/g++.dg/pr86159.C
new file mode 100644
index 00000000000..83168f50c4a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr86159.C
@@ -0,0 +1,10 @@
+// { dg-do compile }
+// { dg-options "-O -w -Wno-psabi" }
+
+typedef int vec __attribute__((vector_size(32)));
+vec fn1()
+{
+  vec x, zero{};
+  vec one = zero + 1;
+  return x < zero ? one : zero;
+}
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 445657b0836..84e58e66628 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -9250,8 +9250,6 @@ gimplify_build3 (gimple_stmt_iterator *gsi, enum tree_code code,
   location_t loc = gimple_location (gsi_stmt (*gsi));
 
   ret = fold_build3_loc (loc, code, type, a, b, c);
-  STRIP_NOPS (ret);
-
   return force_gimple_operand_gsi (gsi, ret, true, NULL, true,
                                    GSI_SAME_STMT);
 }
@@ -9266,8 +9264,6 @@ gimplify_build2 (gimple_stmt_iterator *gsi, enum tree_code code,
   tree ret;
 
   ret = fold_build2_loc (gimple_location (gsi_stmt (*gsi)), code, type, a, b);
-  STRIP_NOPS (ret);
-
   return force_gimple_operand_gsi (gsi, ret, true, NULL, true,
                                    GSI_SAME_STMT);
 }
@@ -9282,8 +9278,6 @@ gimplify_build1 (gimple_stmt_iterator *gsi, enum tree_code code, tree type,
   tree ret;
 
   ret = fold_build1_loc (gimple_location (gsi_stmt (*gsi)), code, type, a);
-  STRIP_NOPS (ret);
-
   return force_gimple_operand_gsi (gsi, ret, true, NULL, true,
                                    GSI_SAME_STMT);
 }


                 reply	other threads:[~2021-05-14 14:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210514145627.7EDBC3951815@sourceware.org \
    --to=jakub@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).