diff options
author | Martin Jambor <mjambor@suse.cz> | 2009-11-27 23:34:40 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2009-11-27 23:34:40 +0100 |
commit | c4ea52007a19f6d93874f04eb18d96f252644d79 (patch) | |
tree | 608ae5b538719e40f3eb16c507e1d54eb8afc0ce /gcc | |
parent | ba96438334721b0d48bf9a1413a6c0963ddbd30f (diff) | |
download | gcc-c4ea52007a19f6d93874f04eb18d96f252644d79.zip gcc-c4ea52007a19f6d93874f04eb18d96f252644d79.tar.gz gcc-c4ea52007a19f6d93874f04eb18d96f252644d79.tar.bz2 |
re PR middle-end/42006 (Termination problem with -O2 and -O3)
2009-11-27 Martin Jambor <mjambor@suse.cz>
PR middle-end/42006
* tree-sra.c (get_replaced_param_substitute): Call create_tmp_var
instead of create_tmp_var. Set DECL_GIMPLE_REG_P to one manually
for vector and complex types.
(get_adjustment_for_base): Describe return value in the comment.
* testsuite/gcc.c-torture/execute/pr42006.c: New test.
From-SVN: r154715
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr42006.c | 33 | ||||
-rw-r--r-- | gcc/tree-sra.c | 8 |
4 files changed, 52 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ac3240c..02faa00 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2009-11-27 Martin Jambor <mjambor@suse.cz> + + PR middle-end/42006 + * tree-sra.c (get_replaced_param_substitute): Call create_tmp_var + instead of create_tmp_var. Set DECL_GIMPLE_REG_P to one manually + for vector and complex types. + (get_adjustment_for_base): Describe return value in the comment. + 2009-11-27 Nick Clifton <nickc@redhat.com> * longlong.h (count_leading_zeros): Define macro for stormy16 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 80ad4c2..e938d3c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-11-27 Martin Jambor <mjambor@suse.cz> + + PR middle-end/42006 + * gcc.c-torture/execute/pr42006.c: New test. + 2009-11-27 Paolo Carlini <paolo.carlini@oracle.com> PR c++/38656 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr42006.c b/gcc/testsuite/gcc.c-torture/execute/pr42006.c new file mode 100644 index 0000000..f40fc17 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr42006.c @@ -0,0 +1,33 @@ +extern void abort (void); + +static unsigned int +my_add(unsigned int si1, unsigned int si2) +{ + return (si1 > (50-si2)) ? si1 : (si1 + si2); +} + +static unsigned int +my_shift(unsigned int left, unsigned int right) +{ + return (right > 100) ? left : (left >> right); +} + +static int func_4(unsigned int p_6) +{ + int count = 0; + for (p_6 = 1; p_6 < 3; p_6 = my_add(p_6, 1)) + { + if (count++ > 1) + abort (); + + if (my_shift(p_6, p_6)) + return 0; + } + return 0; +} + +int main(void) +{ + func_4(0); + return 0; +} diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 5203685..34c0d3d 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -3478,7 +3478,10 @@ get_replaced_param_substitute (struct ipa_parm_adjustment *adj) { char *pretty_name = make_fancy_name (adj->base); - repl = make_rename_temp (TREE_TYPE (adj->base), "ISR"); + repl = create_tmp_var (TREE_TYPE (adj->base), "ISR"); + if (TREE_CODE (TREE_TYPE (repl)) == COMPLEX_TYPE + || TREE_CODE (TREE_TYPE (repl)) == VECTOR_TYPE) + DECL_GIMPLE_REG_P (repl) = 1; DECL_NAME (repl) = get_identifier (pretty_name); obstack_free (&name_obstack, pretty_name); @@ -3516,7 +3519,8 @@ get_adjustment_for_base (ipa_parm_adjustment_vec adjustments, tree base) /* Callback for scan_function. If the statement STMT defines an SSA_NAME of a parameter which is to be removed because its value is not used, replace the SSA_NAME with a one relating to a created VAR_DECL and replace all of its - uses too. DATA is a pointer to an adjustments vector. */ + uses too and return true (update_stmt is then issued for the statement by + the caller). DATA is a pointer to an adjustments vector. */ static bool replace_removed_params_ssa_names (gimple stmt, void *data) |