Skip to content
Snippets Groups Projects
Commit 22fe0312 authored by Richard Biener's avatar Richard Biener Committed by Richard Biener
Browse files

re PR tree-optimization/89541 (ICE in VN_INFO(tree_node*))

2019-03-01  Richard Biener  <rguenther@suse.de>

	PR middle-end/89541
	* tree-ssa-operands.c (add_stmt_operand): CONST_DECL may
	get virtual operands.
	(get_expr_operands): Handle CONST_DECL like other decls.

	* gfortran.dg/pr89451.f90: New testcase.

From-SVN: r269307
parent 9503d7b1
No related branches found
No related tags found
No related merge requests found
2019-03-01 Richard Biener <rguenther@suse.de>
PR middle-end/89541
* tree-ssa-operands.c (add_stmt_operand): CONST_DECL may
get virtual operands.
(get_expr_operands): Handle CONST_DECL like other decls.
2019-03-01 Jakub Jelinek <jakub@redhat.com> 2019-03-01 Jakub Jelinek <jakub@redhat.com>
PR middle-end/89503 PR middle-end/89503
......
2019-03-01 Richard Biener <rguenther@suse.de>
PR middle-end/89541
* gfortran.dg/pr89451.f90: New testcase.
2019-03-01 Richard Biener <rguenther@suse.de> 2019-03-01 Richard Biener <rguenther@suse.de>
PR middle-end/89497 PR middle-end/89497
......
! { dg-do compile }
! { dg-options "-O2" }
program lh
call za(0)
call za(0)
contains
subroutine za(wl)
integer wl
wl = 1
end subroutine za
end program lh
...@@ -515,7 +515,9 @@ add_stmt_operand (struct function *fn, tree *var_p, gimple *stmt, int flags) ...@@ -515,7 +515,9 @@ add_stmt_operand (struct function *fn, tree *var_p, gimple *stmt, int flags)
{ {
tree var = *var_p; tree var = *var_p;
gcc_assert (SSA_VAR_P (*var_p) || TREE_CODE (*var_p) == STRING_CST); gcc_assert (SSA_VAR_P (*var_p)
|| TREE_CODE (*var_p) == STRING_CST
|| TREE_CODE (*var_p) == CONST_DECL);
if (is_gimple_reg (var)) if (is_gimple_reg (var))
{ {
...@@ -741,6 +743,7 @@ get_expr_operands (struct function *fn, gimple *stmt, tree *expr_p, int flags) ...@@ -741,6 +743,7 @@ get_expr_operands (struct function *fn, gimple *stmt, tree *expr_p, int flags)
case PARM_DECL: case PARM_DECL:
case RESULT_DECL: case RESULT_DECL:
case STRING_CST: case STRING_CST:
case CONST_DECL:
if (!(flags & opf_address_taken)) if (!(flags & opf_address_taken))
add_stmt_operand (fn, expr_p, stmt, flags); add_stmt_operand (fn, expr_p, stmt, flags);
return; return;
...@@ -859,7 +862,6 @@ get_expr_operands (struct function *fn, gimple *stmt, tree *expr_p, int flags) ...@@ -859,7 +862,6 @@ get_expr_operands (struct function *fn, gimple *stmt, tree *expr_p, int flags)
case FUNCTION_DECL: case FUNCTION_DECL:
case LABEL_DECL: case LABEL_DECL:
case CONST_DECL:
case CASE_LABEL_EXPR: case CASE_LABEL_EXPR:
/* Expressions that make no memory references. */ /* Expressions that make no memory references. */
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment