From 660880654ab4076aeb85498be24440dfb5a6638d Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 15 Aug 2016 10:31:05 +0200 Subject: [PATCH] re PR tree-optimization/72824 (Signed floating point zero semantics broken at optimization level -O3 (tree-loop-distribute-patterns)) PR tree-optimization/72824 * tree-loop-distribution.c (const_with_all_bytes_same) : Fix a typo. * gcc.c-torture/execute/ieee/pr72824-2.c: New test. From-SVN: r239461 --- gcc/ChangeLog | 9 ++++++-- gcc/testsuite/ChangeLog | 5 +++++ .../gcc.c-torture/execute/ieee/pr72824-2.c | 21 +++++++++++++++++++ gcc/tree-loop-distribution.c | 2 +- 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/execute/ieee/pr72824-2.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ac4732e3366..f71df9c10d3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-08-15 Martin Liska + Jakub Jelinek + + PR tree-optimization/72824 + * tree-loop-distribution.c (const_with_all_bytes_same) + : Fix a typo. + 2016-08-14 Uros Bizjak PR target/76342 @@ -66,7 +73,6 @@ make sure we have a leader for it. 2016-08-12 Martin Liska - Adam Fineman * gcov.c (process_file): Create .gcov file when .gcda @@ -877,7 +883,6 @@ (aapcs_vfp_sub_candidate): Likewise. 2016-08-05 Martin Liska - Joshua Cranmer * gcov.c (line_t::has_block): New function. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ee1f86f2ece..6fa7c1f274f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-08-15 Jakub Jelinek + + PR tree-optimization/72824 + * gcc.c-torture/execute/ieee/pr72824-2.c: New test. + 2016-08-14 Chung-Lin Tang PR fortran/70598 diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/pr72824-2.c b/gcc/testsuite/gcc.c-torture/execute/ieee/pr72824-2.c new file mode 100644 index 00000000000..0622d01d21b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/pr72824-2.c @@ -0,0 +1,21 @@ +/* PR tree-optimization/72824 */ + +typedef float V __attribute__((vector_size (4 * sizeof (float)))); + +static inline void +foo (V *x, V value) +{ + int i; + for (i = 0; i < 32; ++i) + x[i] = value; +} + +int +main () +{ + V x[32]; + foo (x, (V) { 0.f, -0.f, 0.f, -0.f }); + if (__builtin_copysignf (1.0, x[3][1]) != -1.0f) + __builtin_abort (); + return 0; +} diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 342b9647fe7..5580f286ccf 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -774,7 +774,7 @@ const_with_all_bytes_same (tree val) case VECTOR_CST: unsigned int j; for (j = 0; j < VECTOR_CST_NELTS (val); ++j) - if (const_with_all_bytes_same (VECTOR_CST_ELT (val, i))) + if (const_with_all_bytes_same (VECTOR_CST_ELT (val, j))) break; if (j == VECTOR_CST_NELTS (val)) return 0; -- 2.30.2