public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [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
@ 2021-05-14 14:56 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-05-14 14:56 UTC (permalink / raw)
  To: gcc-cvs

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);
 }


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

only message in thread, other threads:[~2021-05-14 14:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 14:56 [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 Jakub Jelinek

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