diff options
author | Uros Bizjak <uros@gcc.gnu.org> | 2007-07-09 15:00:19 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2007-07-09 15:00:19 +0200 |
commit | 8b4c775b68bd734b6b7017c0c4905e0e7c3c41bc (patch) | |
tree | 5a8686dc82a58fef1371445e8ca7a4c1722b4d48 /gcc | |
parent | d241cd48e0e43ac4f3db513e32e0b66805b4a87f (diff) | |
download | gcc-8b4c775b68bd734b6b7017c0c4905e0e7c3c41bc.zip gcc-8b4c775b68bd734b6b7017c0c4905e0e7c3c41bc.tar.gz gcc-8b4c775b68bd734b6b7017c0c4905e0e7c3c41bc.tar.bz2 |
re PR tree-optimization/32681 (ice for legal C code with flags -ffast-math -O3 -ftree-vectorize)
PR tree-optimization/32681
* tree-if-conv.c (find_phi_replacement_condition): Use the condition
saved in second_edge->aux when first_bb is a loop header.
testsuite/ChangeLog:
PR tree-optimization/32681
* gcc.dg/tree-ssa/pr32681.c: New test.
From-SVN: r126482
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/pr32681.c | 21 | ||||
-rw-r--r-- | gcc/tree-if-conv.c | 2 |
4 files changed, 38 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index daa2d94..ca82ac2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-07-09 Uros Bizjak <ubizjak@gmail.com> + + PR tree-optimization/32681 + * tree-if-conv.c (find_phi_replacement_condition): Use the condition + saved in second_edge->aux when first_bb is a loop header. + 2007-07-09 Jan HUbicka <jh@suse.cz> * cse.c (cse_insn): Avoid invalid sharing on trial replacement. @@ -152,8 +158,8 @@ replaced with shift_count_type. (__cmpdi2, __ucmpdi2): word_type of return type replaced with cmp_return_type. - * c-common.c (handle_mode_attribute): Handling for libgcc_cmp_return and - libgcc_shift_count attribute added. + * c-common.c (handle_mode_attribute): Handling for libgcc_cmp_return + and libgcc_shift_count attribute added. * target-def.h (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): New target hooks defined. (TARGET_INITIALIZER): New target hooks added. @@ -173,8 +179,8 @@ * config/s390/s390.c (s390_libgcc_cmp_return_mode, s390_libgcc_shift_count_mode): Functions added. - (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): Target - hooks defined. + (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): + Target hooks defined. 2007-07-06 Richard Sandiford <richard@codesourcery.com> @@ -199,7 +205,7 @@ 2007-07-06 Uros Bizjak <ubizjak@gmail.com> - PR rtl_optimization/32450 + PR rtl-optimization/32450 * function.c (thread_prologue_and_epilogue_insns): Emit blockage insn to ensure that instructions are not moved into the prologue when profiling is on. Remove unused prologue_end variable. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6d03acc..6e61609 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-07-09 Uros Bizjak <ubizjak@gmail.com> + + PR tree-optimization/32681 + * gcc.dg/tree-ssa/pr32681.c: New test. + 2007-07-08 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/32678 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr32681.c b/gcc/testsuite/gcc.dg/tree-ssa/pr32681.c new file mode 100644 index 0000000..2352342 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr32681.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -ffast-math -ftree-vectorize" } */ +/* { dg-options "-O3 -ffast-math -ftree-vectorize -march=nocona" { target { i?86-*-* x86_64-*-* } } } */ + +int aa_renderpalette (int p) +{ + int y = 42; + int i; + + for (i = 0; i < 256; i++) + { + if (y > 255) + y = 255; + if (y < 0) + y = 0; + + if (p) + y = (y < p ? 0 : (y > p) * 255 / (255 - 2 * p)); + } + return y; +} diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index c1ce57e..4714bd7 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -751,7 +751,7 @@ find_phi_replacement_condition (struct loop *loop, AND it with the incoming bb predicate. */ if (second_edge->aux) *cond = build2 (TRUTH_AND_EXPR, boolean_type_node, - *cond, first_edge->aux); + *cond, second_edge->aux); if (TREE_CODE (*cond) == TRUTH_NOT_EXPR) /* We can be smart here and choose inverted |