This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PR71252][PR71269] Fix trunk errors due to stmt_to_insert


Hi,


Sorry for the breakage due to the changes to tree-reassoc. Attached
patch fixes this.

I have tested the patch with spec2006 and cp2k_single_file.f90 from
PR71252 in a x86-640linux-gnu.

./build/gcc/f951 cp2k_single_file.f90 -O3 -ffast-math -march=westmere
works fine.

Tested testcase from PR71269 on gcc2-power8.

In spec2006, I saw couple of errors which I believe are not related:

1.
1464224082.10: /home/kugan.vivekanandarajah/1/usr/local/include/c++/7.0.0/bits/postypes.h:216:5:
note: candidate: template<class _StateT> bool std::operator==(const
std::fpos<_StateT>&, const std::fpos<_StateT>&)
1464224082.10:      operator==(const fpos<_StateT>& __lhs, const
fpos<_StateT>& __rhs)
1464224082.10:      ^~~~~~~~
1464224082.10: /home/kugan.vivekanandarajah/1/usr/local/include/c++/7.0.0/bits/postypes.h:216:5:
note:   template argument deduction/substitution failed:
1464224082.10: mpsinput.cc:75:55: note:
'std::basic_istream<char>::__istream_type {aka
std::basic_istream<char>}' is not derived from 'const
std::fpos<_StateT>'
1464224082.10:           if (m_input.getline(m_buf, sizeof(m_buf)) == 0)
1464224082.10:                                                        ^
1464224082.16: specmake[1]: *** [mpsinput.o] Error 1
1464224082.16: specmake[1]: *** Waiting for unfinished jobs....
1464224084.38: Stop make command: Thu May 26 02:54:44 2016 (1464224084)
1464224084.38: Elapsed time for make command: 00:00:05 (5)
1464224084.38: Error with make 'specmake build': check file
'/home/kugan.vivekanandarajah/CPU2006/benchspec/CPU2006/450.soplex/build/build_base_amd64.0000/make.err'
1464224084.38:   Command returned exit code 2
1464224084.38:   Error with make!
1464224084.39:   Compile for '450.soplex' ended at: Thu May 26
02:54:44 2016 (1464224084)
1464224084.39:   Elapsed compile for '450.soplex': 00:00:05 (5)
1464224084.39: *** Error building 450.soplex


2.
1464224111.69: 0xd99101 thread_through_all_blocks(bool)
1464224111.69:  ../../gcc/gcc/tree-ssa-threadupdate.c:2450
1464224111.70: /home/kugan.vivekanandarajah/1/usr/local/bin/gcc -c -o
SPOOLES/IVL/src/IVL_util.o -DSPEC_CPU -DNDEBUG -ISPOOLES   -static
-static-libgcc -O3 -fno-common       -DSPEC_CPU_LP64
SPOOLES/IVL/src/IVL_util.c
1464224111.71: 0xe202d6 finalize_jump_threads
1464224111.71:  ../../gcc/gcc/tree-vrp.c:10157
1464224111.71: 0xe202d6 execute_vrp
1464224111.71:  ../../gcc/gcc/tree-vrp.c:10311
1464224111.71: 0xe202d6 execute
1464224111.71:  ../../gcc/gcc/tree-vrp.c:10380
1464224111.71: Please submit a full bug report,
1464224111.71: with preprocessed source if appropriate.
1464224111.71: Please include the complete backtrace with any bug report.
1464224111.71: See <http://gcc.gnu.org/bugs.html> for instructions.
1464224111.72: specmake[1]: *** [SPOOLES/Graph/src/Graph_util.o] Error 1
1464224111.72: specmake[1]: *** Waiting for unfinished jobs....
1464224112.43: Stop make command: Thu May 26 02:55:12 2016 (1464224112)
1464224112.43: Elapsed time for make command: 00:00:14 (14)
1464224112.43: Error with make 'specmake build': check file
'/home/kugan.vivekanandarajah/CPU2006/benchspec/CPU2006/454.calculix/build/build_base_amd64.0000/make.err'
1464224112.43:   Command returned exit code 2
1464224112.43:   Error with make!
1464224112.43:   Compile for '454.calculix' ended at: Thu May 26
02:55:12 2016 (1464224112)
1464224112.43:   Elapsed compile for '454.calculix': 00:00:14 (14)
1464224112.43: *** Error building 454.calculix


The issues were:

1. In swap_ops_for_binary_stmt, stmt_to_insert was not swapped. That
was the reason for most of the FAILs. We ended up adding
stmt_to_insert at the wrong place which was not dominating the def.

2. In find_insert_point, I am also making sure that we insert after
the definition of operands of stmt_to_insert.

3. In rewrite_expr_tree_parallel,  build_and_add_sum relies on either
of operand being inserted. If that is not the case, we have to insert
the stmt_to_insert before calling build_and_add_sum.

4. I also moved all the other stmt_to_insert insertion after the use
stmt are created.

Also regression tested on x86-64-linux gnu with no new regressions.

Is this OK for trunk,

Thanks,
Kugan



gcc/ChangeLog:

2016-05-26  Kugan Vivekanandarajah  <kuganv@linaro.org>

    PR middle-end/71269
    PR middle-end/71252
    * tree-ssa-reassoc.c (swap_ops_for_binary_stmt): Handle stmt_to_insert.
    (find_insert_point): If the operands are defined by
    stmt_to_insert, insert after the operand of the stmt_to_insert is defined.
    (rewrite_expr_tree): Add stmt_to_insert after adding the use stmt.
    (reassociate_bb): Likewise.
    (rewrite_expr_tree_parallel): Add stmt_to_insert
    before build_and_add_sum creates new use stmt when the other operand
    to build_and_add_sum dosent have define inst of is a GIMPLE_NOP.


gcc/testsuite/ChangeLog:

2016-05-26  Kugan Vivekanandarajah  <kuganv@linaro.org>

    PR middle-end/71269
    * gcc.dg/tree-ssa/pr71269.c: New test.

Attachment: p.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]