[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-09-13 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

--- Comment #12 from Aldy Hernandez  ---
Author: aldyh
Date: Wed Sep 13 16:53:38 2017
New Revision: 252407

URL: https://gcc.gnu.org/viewcvs?rev=252407&root=gcc&view=rev
Log:
[PR lto/81430] Revert "Add nvptx_override_options_after_change"

This reverts r250421; properly fixed by r250852.

PR lto/81430
* config/nvptx/nvptx.c (nvptx_override_options_after_change):
Remove function.
(TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): Remove definition.

Modified:
branches/range-gen2/gcc/ChangeLog
branches/range-gen2/gcc/config/nvptx/nvptx.c

[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-09-13 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

--- Comment #11 from Aldy Hernandez  ---
Author: aldyh
Date: Wed Sep 13 16:25:39 2017
New Revision: 252276

URL: https://gcc.gnu.org/viewcvs?rev=252276&root=gcc&view=rev
Log:
Apply finish_options on DECL_FUNCTION_SPECIFIC_OPTIMIZATION for ACCEL_COMPILER

2017-08-03  Tom de Vries  

PR lto/81430
* tree-streamer-in.c (lto_input_ts_function_decl_tree_pointers): If
ACCEL_COMPILER, apply finish_options on
DECL_FUNCTION_SPECIFIC_OPTIMIZATION.

Modified:
branches/range-gen2/gcc/ChangeLog
branches/range-gen2/gcc/tree-streamer-in.c

[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-08-11 Thread tschwinge at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

--- Comment #10 from Thomas Schwinge  ---
Author: tschwinge
Date: Fri Aug 11 15:37:14 2017
New Revision: 251053

URL: https://gcc.gnu.org/viewcvs?rev=251053&root=gcc&view=rev
Log:
[PR lto/81430] Revert "Add nvptx_override_options_after_change"

This reverts r250421; properly fixed by r250852.

PR lto/81430
* config/nvptx/nvptx.c (nvptx_override_options_after_change):
Remove function.
(TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): Remove definition.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/nvptx/nvptx.c

[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-08-03 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

Tom de Vries  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Tom de Vries  ---
Patch with test-case committed. Marking resolved-fixed.

[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-08-03 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

--- Comment #8 from Tom de Vries  ---
Author: vries
Date: Thu Aug  3 11:37:55 2017
New Revision: 250852

URL: https://gcc.gnu.org/viewcvs?rev=250852&root=gcc&view=rev
Log:
Apply finish_options on DECL_FUNCTION_SPECIFIC_OPTIMIZATION for ACCEL_COMPILER

2017-08-03  Tom de Vries  

PR lto/81430
* tree-streamer-in.c (lto_input_ts_function_decl_tree_pointers): If
ACCEL_COMPILER, apply finish_options on
DECL_FUNCTION_SPECIFIC_OPTIMIZATION.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-streamer-in.c

[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-07-21 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

--- Comment #7 from Tom de Vries  ---
Author: vries
Date: Fri Jul 21 09:46:05 2017
New Revision: 250421

URL: https://gcc.gnu.org/viewcvs?rev=250421&root=gcc&view=rev
Log:
Add nvptx_override_options_after_change

2017-07-21  Tom de Vries  

PR lto/81430
* config/nvptx/nvptx.c (nvptx_override_options_after_change): New
function.
(TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): Define to
nvptx_override_options_after_change.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/nvptx/nvptx.c

[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-07-20 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

--- Comment #6 from Tom de Vries  ---
https://gcc.gnu.org/ml/gcc-patches/2017-07/msg01210.html

[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-07-20 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

Tom de Vries  changed:

   What|Removed |Added

   Severity|trivial |normal

[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-07-20 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

Tom de Vries  changed:

   What|Removed |Added

   Keywords||patch
   Severity|normal  |trivial

[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-07-19 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

--- Comment #5 from Tom de Vries  ---
Created attachment 41788
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41788&action=edit
for lto1, call finish_options after cl_optimization_restore in
invoke_set_current_function_hook

This is an attempt to actually fix the issue, by reusing finish_options in
lto1.

[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-07-19 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

--- Comment #4 from Tom de Vries  ---
Created attachment 41786
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41786&action=edit
set flag_reorder_blocks_and_partition to 0 in
nvptx_override_options_after_change

This works around the issue in the target, instead of in the common code as the
previous patch did.

[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-07-16 Thread tschwinge at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

Thomas Schwinge  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-07-16
 Ever confirmed|0   |1

--- Comment #3 from Thomas Schwinge  ---
Per my testing, r249070 is causing the regressions listed below.  Looking at a
few cases, we're running into:

[...]/libgomp.oacc-c-c++-common/vector-type-1.c: In function
'main._omp_fn.0':
[...]/libgomp.oacc-c-c++-common/vector-type-1.c:7:9: sorry, unimplemented:
target cannot support label values
 #pragma acc parallel copy(vi)
 ^
[...]/libgomp.oacc-c-c++-common/vector-type-1.c:7:9: sorry, unimplemented:
indirect jumps are not available on this target

Program received signal SIGSEGV, Segmentation fault.
fix_crossing_unconditional_branches () at [...]/gcc/bb-reorder.c:2215
2215  JUMP_LABEL (jump_insn) = label;
(gdb) bt
#0  fix_crossing_unconditional_branches () at [...]/gcc/bb-reorder.c:2215
#1  (anonymous namespace)::pass_partition_blocks::execute (this=, fun=0x76956000) at [...]/gcc/bb-reorder.c:2910
#2  0x0098364d in execute_one_pass (pass=pass@entry=0x1725070) at
[...]/gcc/passes.c:2491
#3  0x00983f18 in execute_pass_list_1 (pass=0x1725070) at
[...]/gcc/passes.c:2580
#4  0x00983f2a in execute_pass_list_1 (pass=0x1724470) at
[...]/gcc/passes.c:2581
#5  0x00983f75 in execute_pass_list (fn=,
pass=) at [...]/gcc/passes.c:2591
#6  0x00635217 in cgraph_node::expand
(this=this@entry=0x76952000) at [...]/gcc/cgraphunit.c:2050
#7  0x00636bbc in expand_all_functions () at
[...]/gcc/cgraphunit.c:2186
#8  symbol_table::compile (this=0x76888000) at
[...]/gcc/cgraphunit.c:2543
#9  0x006370a6 in symbol_table::compile (this=) at
[...]/gcc/cgraphunit.c:2576
#10 0x00593462 in lto_main () at [...]/gcc/lto/lto.c:3334
#11 0x00a5ad8f in compile_file () at [...]/gcc/toplev.c:468
#12 0x00560e82 in do_compile () at [...]/gcc/toplev.c:2021
#13 toplev::main (this=this@entry=0x7fffcfb0, argc=argc@entry=19,
argv=0x16fc7d0, argv@entry=0x7fffd0b8) at [...]/gcc/toplev.c:2155
#14 0x005632f7 in main (argc=19, argv=0x7fffd0b8) at
[...]/gcc/main.c:39

Tom's patch (plus '#include "common/common-target.h"') does cure this.

List of regressions:

[-PASS:-]{+FAIL: libgomp.c/examples-4/async_target-2.c (internal compiler
error)+}
{+FAIL:+} libgomp.c/examples-4/async_target-2.c (test for excess errors)
[-PASS:-]{+UNRESOLVED:+} libgomp.c/examples-4/async_target-2.c [-execution
test-]{+compilation failed to produce executable+}

[-PASS:-]{+FAIL: libgomp.c/examples-4/target-5.c (internal compiler
error)+}
{+FAIL:+} libgomp.c/examples-4/target-5.c (test for excess errors)
[-PASS:-]{+UNRESOLVED:+} libgomp.c/examples-4/target-5.c [-execution
test-]{+compilation failed to produce executable+}

[-PASS:-]{+FAIL: libgomp.c/examples-4/target_data-6.c (internal compiler
error)+}
{+FAIL:+} libgomp.c/examples-4/target_data-6.c (test for excess errors)
[-PASS:-]{+UNRESOLVED:+} libgomp.c/examples-4/target_data-6.c [-execution
test-]{+compilation failed to produce executable+}

[-PASS:-]{+FAIL: libgomp.c/examples-4/target_data-7.c (internal compiler
error)+}
{+FAIL:+} libgomp.c/examples-4/target_data-7.c (test for excess errors)
[-PASS:-]{+UNRESOLVED:+} libgomp.c/examples-4/target_data-7.c [-execution
test-]{+compilation failed to produce executable+}

[-PASS:-]{+FAIL: libgomp.c/target-3.c (internal compiler error)+}
{+FAIL:+} libgomp.c/target-3.c (test for excess errors)
[-PASS:-]{+UNRESOLVED:+} libgomp.c/target-3.c [-execution
test-]{+compilation failed to produce executable+}

[-PASS:-]{+FAIL: libgomp.c/target-4.c (internal compiler error)+}
{+FAIL:+} libgomp.c/target-4.c (test for excess errors)
[-PASS:-]{+UNRESOLVED:+} libgomp.c/target-4.c [-execution
test-]{+compilation failed to produce executable+}

[-PASS:-]{+FAIL: libgomp.c/target-5.c (internal compiler error)+}
{+FAIL:+} libgomp.c/target-5.c (test for excess errors)
[-PASS:-]{+UNRESOLVED:+} libgomp.c/target-5.c [-execution
test-]{+compilation failed to produce executable+}

[-PASS:-]{+FAIL: libgomp.c/target-6.c (internal compiler error)+}
{+FAIL:+} libgomp.c/target-6.c (test for excess errors)
[-PASS:-]{+UNRESOLVED:+} libgomp.c/target-6.c [-execution
test-]{+compilation failed to produce executable+}

[-PASS:-]{+FAIL: libgomp.c/target-7.c (internal compiler error)+}
{+FAIL:+} libgomp.c/target-7.c (test for excess errors)
[-PASS:-]{+UNRESOLVED:+} libgomp.c/target-7.c [-execution
test-]{+compilation failed to produce executable+}

{+FAIL: libgomp.c/threa

[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-07-13 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

--- Comment #2 from Tom de Vries  ---
Created attachment 41748
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41748&action=edit
Test for targetm_common.have_named_sections in pass_partition_blocks::gate

Patch I'm currently testing.

Not sure if this is the proper way to fix this though.

[Bug lto/81430] nvptx acceleration compilation broken because of running pass_partition_blocks

2017-07-13 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81430

--- Comment #1 from Tom de Vries  ---
This PR may have been triggered by "Do not silently disable
flag_reorder_functions when profile info is missing" ( 
https://gcc.gnu.org/ml/gcc-patches/2017-06/msg00518.html )