diff options
author | Richard Guenther <rguenther@suse.de> | 2010-04-02 16:50:04 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-04-02 16:50:04 +0000 |
commit | 1cdaa211989e0de46e77f46d42367c42f9a0831c (patch) | |
tree | 7db1d8b1c940c4988eb8031069cc5033efd35a1a /gcc | |
parent | d33da5cd571f4e3350589a905ab6c6001f763e69 (diff) | |
download | gcc-1cdaa211989e0de46e77f46d42367c42f9a0831c.zip gcc-1cdaa211989e0de46e77f46d42367c42f9a0831c.tar.gz gcc-1cdaa211989e0de46e77f46d42367c42f9a0831c.tar.bz2 |
re PR tree-optimization/43629 (Struct to register optimization fails)
2010-04-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43629
* tree-ssa-ccp.c (likely_value): Reset all_undefined_operands
if we have seen a constant value.
* gcc.c-torture/execute/pr43629.c: New testcase.
From-SVN: r157944
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr43629.c | 13 | ||||
-rw-r--r-- | gcc/tree-ssa-ccp.c | 7 |
4 files changed, 29 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a1e3c97..9ba9e7a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-04-02 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/43629 + * tree-ssa-ccp.c (likely_value): Reset all_undefined_operands + if we have seen a constant value. + 2010-04-02 Joseph Myers <joseph@codesourcery.com> * read-rtl.c (read_rtx_1): Give an error for EOF while looking for diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 16b901b..54ec007 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-04-02 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/43629 + * gcc.c-torture/execute/pr43629.c: New testcase. + 2010-04-01 Janne Blomqvist <jb@gcc.gnu.org> Dominique d'Humieres <dominiq@lps.ens.fr> diff --git a/gcc/testsuite/gcc.c-torture/execute/pr43629.c b/gcc/testsuite/gcc.c-torture/execute/pr43629.c new file mode 100644 index 0000000..10c0196 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr43629.c @@ -0,0 +1,13 @@ +int flag; +extern void abort (void); +int main() +{ + int x; + if (flag) + x = -1; + else + x &= 0xff; + if (x & ~0xff) + abort (); + return 0; +} diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 03c3500..fcfdd18 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -1,6 +1,6 @@ /* Conditional constant propagation pass for the GNU compiler. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 - Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010 Free Software Foundation, Inc. Adapted from original RTL SSA-CCP by Daniel Berlin <dberlin@dberlin.org> Adapted to GIMPLE trees by Diego Novillo <dnovillo@redhat.com> @@ -558,6 +558,9 @@ likely_value (gimple stmt) has_constant_operand = true; } + if (has_constant_operand) + all_undefined_operands = false; + /* If the operation combines operands like COMPLEX_EXPR make sure to not mark the result UNDEFINED if only one part of the result is undefined. */ |