mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-22 03:46:53 -05:00
re PR tree-optimization/32353 (Miscompilation with RESULT_DECL)
PR tree-optimization/32353 * tree-ssa-structalias.c (set_uids_in_ptset): Also handle RESULT_DECL. * g++.dg/opt/nrv13.C: New test. From-SVN: r125842
This commit is contained in:
committed by
Jakub Jelinek
parent
2ce43a383b
commit
4f0e4109bf
@@ -1,3 +1,8 @@
|
||||
2007-06-19 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/32353
|
||||
* tree-ssa-structalias.c (set_uids_in_ptset): Also handle RESULT_DECL.
|
||||
|
||||
2007-06-17 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||
|
||||
* config/sparc/sparc.c (sparc_vis_init_builtins): Retrieve the
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2007-06-19 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/32353
|
||||
* g++.dg/opt/nrv13.C: New test.
|
||||
|
||||
2007-06-15 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* g++.dg/lookup/anon6.C: New test.
|
||||
|
||||
42
gcc/testsuite/g++.dg/opt/nrv13.C
Normal file
42
gcc/testsuite/g++.dg/opt/nrv13.C
Normal file
@@ -0,0 +1,42 @@
|
||||
// PR tree-optimization/32353
|
||||
// { dg-do run }
|
||||
// { dg-options "-O2" }
|
||||
|
||||
extern "C" void abort ();
|
||||
|
||||
struct A
|
||||
{
|
||||
int f;
|
||||
A (int x) : f (x) {}
|
||||
};
|
||||
|
||||
A
|
||||
foo (const A &x, const A &y)
|
||||
{
|
||||
A r (0);
|
||||
r = x.f == -111 ? y : (y.f == -111 || x.f > y.f) ? x : y;
|
||||
A s (0);
|
||||
r = r.f == -111 ? s : (r.f > s.f) ? r : s;
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (foo (A (0), A (1)).f != 1)
|
||||
abort ();
|
||||
if (foo (A (1), A (9)).f != 9)
|
||||
abort ();
|
||||
if (foo (A (9), A (1)).f != 9)
|
||||
abort ();
|
||||
if (foo (A (-4), A (-5)).f != 0)
|
||||
abort ();
|
||||
if (foo (A (-111), A (-111)).f != 0)
|
||||
abort ();
|
||||
if (foo (A (2), A (-111)).f != 2)
|
||||
abort ();
|
||||
if (foo (A (-111), A (6)).f != 6)
|
||||
abort ();
|
||||
if (foo (A (-111), A (-4)).f != 0)
|
||||
abort ();
|
||||
}
|
||||
@@ -4343,7 +4343,8 @@ set_uids_in_ptset (tree ptr, bitmap into, bitmap from)
|
||||
bitmap_set_bit (into, DECL_UID (sv->var));
|
||||
}
|
||||
else if (TREE_CODE (vi->decl) == VAR_DECL
|
||||
|| TREE_CODE (vi->decl) == PARM_DECL)
|
||||
|| TREE_CODE (vi->decl) == PARM_DECL
|
||||
|| TREE_CODE (vi->decl) == RESULT_DECL)
|
||||
{
|
||||
if (var_can_have_subvars (vi->decl)
|
||||
&& get_subvars_for_var (vi->decl))
|
||||
|
||||
Reference in New Issue
Block a user