re PR tree-optimization/88792 (wrong-code in RPO VN since r263875)

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

	PR tree-optimization/88792
	* tree-ssa-pre.c (get_representative_for): Do not return a
	value-number here.

	* gcc.dg/torture/pr88792.c: New testcase.

From-SVN: r267821
This commit is contained in:
Richard Biener 2019-01-10 18:58:08 +00:00 committed by Richard Biener
parent bebf94afe5
commit f25507d041
4 changed files with 44 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2019-01-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/88792
* tree-ssa-pre.c (get_representative_for): Do not return a
value-number here.
2019-01-10 Jakub Jelinek <jakub@redhat.com>
PR middle-end/84877

View File

@ -1,3 +1,8 @@
2019-01-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/88792
* gcc.dg/torture/pr88792.c: New testcase.
2019-01-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/86322

View File

@ -0,0 +1,32 @@
/* { dg-do run } */
int one = 1;
char
__attribute__((noipa))
foo(char v)
{
int modec;
if (one)
{
modec = ((v < 'A' || v > 'Z') ? v : v + ('a' - 'A'));
if (modec != 't' && modec != 'c' && modec != 'g')
modec = 0;
}
else
modec = 'g';
return modec;
}
int main(int argc, char **argv)
{
char c = 't';
int r = foo (c);
if (r != c)
__builtin_abort ();
return 0;
}

View File

@ -1262,7 +1262,7 @@ get_representative_for (const pre_expr e, basic_block b = NULL)
switch (e->kind)
{
case NAME:
return VN_INFO (PRE_EXPR_NAME (e))->valnum;
return PRE_EXPR_NAME (e);
case CONSTANT:
return PRE_EXPR_CONSTANT (e);
case NARY: