1 Star 0 Fork 132

wangding16/src-gcc

forked from src-openEuler/gcc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0087-Backport-tree-optimization-97238-fix-typo-causing-IC.patch 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
From ae15300352b0fa47a533af852f88e7244c2820cc Mon Sep 17 00:00:00 2001
From: Richard Biener <rguenther@suse.de>
Date: Tue, 29 Sep 2020 14:38:06 +0200
Subject: [PATCH 3/3] [Backport] tree-optimization/97238 - fix typo causing ICE
Reference: https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=29aef377d814bd342dd5a306f99e0d614623ce0e
This fixes a typo causing a NULL dereference.
2020-09-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/97238
* tree-ssa-reassoc.c (ovce_extract_ops): Fix typo.
* gcc.dg/pr97238.c: New testcase.
---
gcc/testsuite/gcc.dg/pr97238.c | 12 ++++++++++++
gcc/tree-ssa-reassoc.c | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/gcc.dg/pr97238.c
diff --git a/gcc/testsuite/gcc.dg/pr97238.c b/gcc/testsuite/gcc.dg/pr97238.c
new file mode 100644
index 000000000..746e93a97
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr97238.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wno-psabi -w" } */
+
+typedef int __attribute__ ((__vector_size__ (8))) V;
+int b, c, e;
+V d;
+
+V
+foo (void)
+{
+ return (b || e) | c > d | ((b || e) | c > d);
+}
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 5f978ac78..62e7c8dca 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -3853,7 +3853,7 @@ ovce_extract_ops (tree var, gassign **rets, bool *reti, tree *type,
return ERROR_MARK;
gassign *assign = dyn_cast<gassign *> (SSA_NAME_DEF_STMT (cond));
- if (stmt == NULL
+ if (assign == NULL
|| TREE_CODE_CLASS (gimple_assign_rhs_code (assign)) != tcc_comparison)
return ERROR_MARK;
--
2.27.0.windows.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangding16/src-gcc.git
git@gitee.com:wangding16/src-gcc.git
wangding16
src-gcc
src-gcc
master

搜索帮助