Bug 26855 - [4.2 Regression] ICE in add_deps_for_def with -fmodulo-sched -maltivec
Summary: [4.2 Regression] ICE in add_deps_for_def with -fmodulo-sched -maltivec
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.2.0
Assignee: Kenneth Zadeck
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2006-03-24 21:41 UTC by Janis Johnson
Modified: 2006-05-20 18:54 UTC (History)
4 users (show)

See Also:
Host:
Target: powerpc-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-03-30 20:11:02


Attachments
minimized testcase (293 bytes, text/plain)
2006-03-24 21:42 UTC, Janis Johnson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Janis Johnson 2006-03-24 21:41:20 UTC
GCC mainline gets an internal compiler error on powerpc-linux building HMMER (http://hmmer.wustl.edu/) with "-O2 -fmodulo-sched -maltivec".  I'll attach a minimized test case.  The failure is with trunk; 4.1 and 4.0 don't fail.

elm3b145% /opt/gcc-nightly/trunk/bin/gcc -O2 -fmodulo-sched -maltivec -c hmmer.c                                                                                
hmmer.c: In function ‘bar’:
hmmer.c:30: internal compiler error: in add_deps_for_def, at ddg.c:243
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
                                                                                
A regression hunt identified this patch:
                                                                                
http://gcc.gnu.org/viewcvs?view=rev&rev=110312
                                                                                
r110312 | zadeck | 2006-01-27 22:23:32 +0000 (Fri, 27 Jan 2006)
Comment 1 Janis Johnson 2006-03-24 21:42:37 UTC
Created attachment 11116 [details]
minimized testcase
Comment 2 Janis Johnson 2006-04-25 23:49:49 UTC
The patch that introduced this failure also causes the same ICE in several SPEC CPU2000 programs on powerpc64-linux for "-O2 -fmodulo-sched" with either -m32 or -m64.  I haven't tried the patch that was supposed to fix the reported bug, http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01642.html, or the follow-up smaller patches which don't seem to have been reviewed yet.  I'm willing to test the proposed patch(es), including building SPEC CPU2000 with multiple sets of options and running the small, test input.
Comment 3 Kenneth Zadeck 2006-04-26 14:50:47 UTC
Yes janis, it is quite likely that that patch will fix this problem.
This looks like exactly the same failure as the other bug that that this patch was submitted for.

Comment 4 Janis Johnson 2006-04-26 17:48:08 UTC
The patch doesn't apply cleanly now, which isn't surprising, but it also doesn't apply to mainline sources as of 2006-03-28, when it was submitted.  What date or revision can I start with to try this patch, without porting it forward to today's sources?
Comment 5 Kenneth Zadeck 2006-04-26 20:51:37 UTC
Subject: Re:  [4.2 Regression] ICE in add_deps_for_def
 with -fmodulo-sched -maltivec

janis at gcc dot gnu dot org wrote:
> ------- Comment #4 from janis at gcc dot gnu dot org  2006-04-26 17:48 -------
> The patch doesn't apply cleanly now, which isn't surprising, but it also
> doesn't apply to mainline sources as of 2006-03-28, when it was submitted. 
> What date or revision can I start with to try this patch, without porting it
> forward to today's sources?
>
>
>   
I will redo the patch tomorrow on the way home from california.
kenny
Comment 6 Janis Johnson 2006-04-26 20:54:02 UTC
Thanks, although I can wait if you have more pressing things to do.
Comment 7 Janis Johnson 2006-04-29 00:02:45 UTC
I tried the patch at http://gcc.gnu.org/ml/gcc-patches/2006-04/msg01061.html on powerpc64-linux and used the resulting compilers with "-O2 -fmodulo-sched" to build SPEC CPU2000 and run with the small, test input, and also built and ran the special version of HMMER (which uses AltiVec macros) with those same options.  I still get lots of failures: some tests ICE in the build, others get runtime failures.  I got failures with different tests when I moved the compiler install tree to a different system, or when I ran it as a different user.  There's something very flaky going on.
Comment 8 Kenneth Zadeck 2006-04-29 04:23:36 UTC
Subject: Re:  [4.2 Regression] ICE in add_deps_for_def
 with -fmodulo-sched -maltivec

janis at gcc dot gnu dot org wrote:
> ------- Comment #7 from janis at gcc dot gnu dot org  2006-04-29 00:02 -------
> I tried the patch at http://gcc.gnu.org/ml/gcc-patches/2006-04/msg01061.html on
> powerpc64-linux and used the resulting compilers with "-O2 -fmodulo-sched" to
> build SPEC CPU2000 and run with the small, test input, and also built and ran
> the special version of HMMER (which uses AltiVec macros) with those same
> options.  I still get lots of failures: some tests ICE in the build, others get
> runtime failures.  I got failures with different tests when I moved the
> compiler install tree to a different system, or when I ran it as a different
> user.  There's something very flaky going on.
>
>
>   
Janis,

I have not tried spec on my powerpc system.  could you send me some a
spec config file and any scripts you use and your special version of
HMMER.   I can build this over the weekend on my g5.

Kenny
Comment 9 zadeck@gcc.gnu.org 2006-05-19 21:18:35 UTC
Subject: Bug 26855

Author: zadeck
Date: Fri May 19 21:18:23 2006
New Revision: 113915

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113915
Log:
2006-05-19  Daniel Berlin  <dberlin@dberlin.org>
            Kenneth Zadeck <zadeck@naturalbridge.com>

	PR rtl-optimization/26855

	* df-scan.c (mw_reg_pool, mw_link_pool): New allocation pools for
	multiword refs.
	(df_scan_alloc): Added code to properly handle multiword hard
	registers and add all_blocks parameter.
	(df_scan_free_internal, df_insn_refs_delete, df_ref_record): Added
	code to properly handle multiword hard registers.
	(df_rescan_blocks): Added code to remove deleted blocks from
	bitmap.
	(df_ref_create_structure, df_ref_record): Added code to properly
	handle subregs.
	(df_ref_record_1): Changed DF_REF_CLOBBER into DF_REF_MUST_CLOBBER
	and set DF_REF_PARTIAL.
	(df_defs_record): Changed DF_REF_CLOBBER into DF_REF_MUST_CLOBBER.
	(df_uses_record): Added DF_REF_PARTIAL for subreg. 
	(df_scan_add_problem): Added flags parameter.
	(df_ref_create_structure): Changed switching structure.
	(df_bb_refs_record): Fixed case where duplicate artificial refs
	were created.  Changed location of flags.
	(df_record_entry_block_defs): Added code to make stack pointer
	live in entry block.  Refined cases where frame pointer is needed.
	Changed location of flags.
	(df_record_exit_block_uses, df_insn_refs_record): Changed location of flags.
	(df_set_state): Removed function.
	(df_grow_reg_info, df_reg_chain_unlink, df_ref_remove,
	df_insn_create_insn_record, df_insn_refs_delete, 
	df_ref_create_structure): Formatting changes.  
	* df-core.c (df_mvs_dump, df_set_flags, df_clear_flags,
	df_delete_basic_block): New function.
	(df_init): Changed location of flags.
	(df_add_problem): Added flags parameter and the way flags are
	processed.
	(df_insn_uid_debug, df_ref_debug, debug_df_defno, debug_df_ref,
	debug_df_chain): Improved debugging output.
	(df_insn_debug, df_insn_uid_debug): Added multiword reg support.
	(df_refs_chain_dump): Removed df parameter.
	(df_iterative_dataflow): Added consistency check.
	(df_prune_to_subcfg): Made public.
	(df_analyze_problem): Added blocks_to_init parameter and made
	public.
	(df_ref_record, df_bb_refs_record, df_mark_reg, 
	 df_record_exit_block_uses): Whitespace changes.
	(df_dump): Whitespace changes.
	* df.h: Some reordering to remove forward references.
	(df_ref_flags.DF_REF_MW_HARDREG, DF_REF_PARTIAL,
	DF_REF_MUST_CLOBBER, DF_REF_MAY_CLOBBER): New fields.
	(df_ref_flags.DF_REF_CLOBBER): Deleted field.
	(dataflow.flags): New field.
	(df.flag): Deleted field.
	(df_alloc_function): Added additional bitmap parameter.
	(df_dependent_problem_function): New type.
	(df_problem.changeable_flags): New field.
	(df_ref_flags.DF_REF_DIES_AFTER_THIS_USE, DF_SCAN_INITIAL,
	DF_SCAN_GLOBAL, DF_SCAN_POST_ALLOC, df_state): Removed.
	(df_mw_hardreg): New struct.
	(DF_INSN_UID_MWS): New macro.
	(df_refs_chain_dump, df_ref_debug, df_chain_dump): Removed df
	parameter.
	(df_add_problem, df_ru_add_problem, df_rd_add_problem,
	df_lr_add_problem, df_ur_add_problem, df_urec_add_problem,
	df_ri_add_problem, df_scan_add_problem): Added flags parameter.
	(df_set_state): Removed function.
	(df_set_flags, df_clear_flags, df_delete_basic_block) New functions.
	* df-problems.c (df_chain_dump): Removed df parameter.
	(df_ru_alloc, df_rd_alloc, df_lr_alloc, df_ur_alloc,
	df_urec_alloc, df_chain_alloc, df_ri_alloc): Added all blocks
	parameter.
	(df_ru_alloc, df_rd_alloc): Now resets all blocks.
	(df_rd_bb_local_compute_process_def, df_ur_bb_local_compute,
	df_chain_create_bb, df_create_unused_note, df_ri_bb_compute):
	Split DF_REF_CLOBBER into DF_REF_MAY_CLOBBER and
	DF_REF_MUST_CLOBBER cases.
	(df_ru_bb_local_compute_process_def,
	df_rd_bb_local_compute_process_def, df_lr_bb_local_compute,
	df_lr_bb_local_compute, df_ur_bb_local_compute,
	df_chain_create_bb): Made subreg aware.
	(df_ru_bb_local_compute, df_rd_bb_local_compute,
	df_lr_bb_local_compute, df_lr_bb_local_compute,
	df_chain_create_bb): Cleanup to use proper macros.
	(df_ur_local_finalize, df_urec_local_finalize): Removed unnecessary
	code to fixup bitvectors.
	(df_ri_alloc): Cleared lifetime.
	(df_ignore_stack_reg, df_kill_notes, df_set_notes_for_mw,
	df_create_unused_note): New function.
	(df_ri_bb_compute, df_ri_compute): Added code to create/update
	REG_DEAD and REG_UNUSED notes as well as register information.
	(df_ru_dump, df_rd_dump, df_lr_dump, df_ur_dump, df_urec_dump,
	df_chains_dump): Fixed crash if problem was never run.
	(df_ru_add_problem, df_rd_add_problem, df_lr_add_problem,
	df_ur_add_problem, df_urec_add_problem, df_chain_add_problem,
	df_ri_add_problem): Processes flags in uniform manner.
	(df_ru_alloc, df_ru_local_compute, df_ru_confluence_n, df_ru_free,
	df_ru_dump, df_rd_local_compute, df_rd_confluence_n, df_rd_free,
	df_rd_dump, df_urec_free_bb_info): Formatting changes.
	(df_ru_free_bb_info, df_ru_bb_local_compute, df_ru_dump,
	df_rd_free_bb_info, df_rd_bb_local_compute_process_def,
	df_rd_bb_local_compute, df_rd_dump, df_lr_free_bb_info,
	df_lr_bb_local_compute, df_lr_local_compute, df_ur_free_bb_info,
	df_ur_dump, df_urec_free_bb_info, df_urec_dump,
	df_chain_create_bb, df_ri_bb_compute): Whitespace changes.
	* modulo-sched.c (sms_schedule): Added flag parameter to calls.
	* see.c (see_initialize_data): Ditto.
	* final.c (rest_of_clean_state) Added regstack_completed.
	* rtl.h (regstack_completed): Ditto.
	* reg-stack.c (regstack_completed): Ditto.


Modified:
    trunk/gcc/df-core.c
    trunk/gcc/df-problems.c
    trunk/gcc/df-scan.c
    trunk/gcc/df.h
    trunk/gcc/final.c
    trunk/gcc/modulo-sched.c
    trunk/gcc/reg-stack.c
    trunk/gcc/rtl.h
    trunk/gcc/see.c

Comment 10 Andrew Pinski 2006-05-20 18:54:14 UTC
Fixed.
Comment 11 Andrew Pinski 2006-05-21 20:49:30 UTC
Subject: Bug 26855

Author: pinskia
Date: Sun May 21 20:48:30 2006
New Revision: 113960

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113960
Log:
Add forgot changelog:
+2006-05-19  Daniel Berlin  <dberlin@dberlin.org>
+            Kenneth Zadeck <zadeck@naturalbridge.com>
+
+       PR rtl-optimization/26855
+
+       * df-scan.c (mw_reg_pool, mw_link_pool): New allocation pools for
+       multiword refs.
+       (df_scan_alloc): Added code to properly handle multiword hard
+       registers and add all_blocks parameter.
+       (df_scan_free_internal, df_insn_refs_delete, df_ref_record): Added
+       code to properly handle multiword hard registers.
+       (df_rescan_blocks): Added code to remove deleted blocks from
+       bitmap.
+       (df_ref_create_structure, df_ref_record): Added code to properly
+       handle subregs.
+       (df_ref_record_1): Changed DF_REF_CLOBBER into DF_REF_MUST_CLOBBER
+       and set DF_REF_PARTIAL.
+       (df_defs_record): Changed DF_REF_CLOBBER into DF_REF_MUST_CLOBBER.
+       (df_uses_record): Added DF_REF_PARTIAL for subreg. 
+       (df_scan_add_problem): Added flags parameter.
+       (df_ref_create_structure): Changed switching structure.
+       (df_bb_refs_record): Fixed case where duplicate artificial refs
+       were created.  Changed location of flags.
+       (df_record_entry_block_defs): Added code to make stack pointer
+       live in entry block.  Refined cases where frame pointer is needed.
+       Changed location of flags.
+       (df_record_exit_block_uses, df_insn_refs_record): Changed location of flags.
+       (df_set_state): Removed function.
+       (df_grow_reg_info, df_reg_chain_unlink, df_ref_remove,
+       df_insn_create_insn_record, df_insn_refs_delete, 
+       df_ref_create_structure): Formatting changes.  
+       * df-core.c (df_mvs_dump, df_set_flags, df_clear_flags,
+       df_delete_basic_block): New function.
+       (df_init): Changed location of flags.
+       (df_add_problem): Added flags parameter and the way flags are
+       processed.
+       (df_insn_uid_debug, df_ref_debug, debug_df_defno, debug_df_ref,
+       debug_df_chain): Improved debugging output.
+       (df_insn_debug, df_insn_uid_debug): Added multiword reg support.
+       (df_refs_chain_dump): Removed df parameter.
+       (df_iterative_dataflow): Added consistency check.
+       (df_prune_to_subcfg): Made public.
+       (df_analyze_problem): Added blocks_to_init parameter and made
+       public.
+       (df_ref_record, df_bb_refs_record, df_mark_reg, 
+        df_record_exit_block_uses): Whitespace changes.
+       (df_dump): Whitespace changes.
+       * df.h: Some reordering to remove forward references.
+       (df_ref_flags.DF_REF_MW_HARDREG, DF_REF_PARTIAL,
+       DF_REF_MUST_CLOBBER, DF_REF_MAY_CLOBBER): New fields.
+       (df_ref_flags.DF_REF_CLOBBER): Deleted field.
+       (dataflow.flags): New field.
+       (df.flag): Deleted field.
+       (df_alloc_function): Added additional bitmap parameter.
+       (df_dependent_problem_function): New type.
+       (df_problem.changeable_flags): New field.
+       (df_ref_flags.DF_REF_DIES_AFTER_THIS_USE, DF_SCAN_INITIAL,
+       DF_SCAN_GLOBAL, DF_SCAN_POST_ALLOC, df_state): Removed.
+       (df_mw_hardreg): New struct.
+       (DF_INSN_UID_MWS): New macro.
+       (df_refs_chain_dump, df_ref_debug, df_chain_dump): Removed df
+       parameter.
+       (df_add_problem, df_ru_add_problem, df_rd_add_problem,
+       df_lr_add_problem, df_ur_add_problem, df_urec_add_problem,
+       df_ri_add_problem, df_scan_add_problem): Added flags parameter.
+       (df_set_state): Removed function.
+       (df_set_flags, df_clear_flags, df_delete_basic_block) New functions.
+       * df-problems.c (df_chain_dump): Removed df parameter.
+       (df_ru_alloc, df_rd_alloc, df_lr_alloc, df_ur_alloc,
+       df_urec_alloc, df_chain_alloc, df_ri_alloc): Added all blocks
+       parameter.
+       (df_ru_alloc, df_rd_alloc): Now resets all blocks.
+       (df_rd_bb_local_compute_process_def, df_ur_bb_local_compute,
+       df_chain_create_bb, df_create_unused_note, df_ri_bb_compute):
+       Split DF_REF_CLOBBER into DF_REF_MAY_CLOBBER and
+       DF_REF_MUST_CLOBBER cases.
+       (df_ru_bb_local_compute_process_def,
+       df_rd_bb_local_compute_process_def, df_lr_bb_local_compute,
+       df_lr_bb_local_compute, df_ur_bb_local_compute,
+       df_chain_create_bb): Made subreg aware.
+       (df_ru_bb_local_compute, df_rd_bb_local_compute,
+       df_lr_bb_local_compute, df_lr_bb_local_compute,
+       df_chain_create_bb): Cleanup to use proper macros.
+       (df_ur_local_finalize, df_urec_local_finalize): Removed unnecessary
+       code to fixup bitvectors.
+       (df_ri_alloc): Cleared lifetime.
+       (df_ignore_stack_reg, df_kill_notes, df_set_notes_for_mw,
+       df_create_unused_note): New function.
+       (df_ri_bb_compute, df_ri_compute): Added code to create/update
+       REG_DEAD and REG_UNUSED notes as well as register information.
+       (df_ru_dump, df_rd_dump, df_lr_dump, df_ur_dump, df_urec_dump,
+       df_chains_dump): Fixed crash if problem was never run.
+       (df_ru_add_problem, df_rd_add_problem, df_lr_add_problem,
+       df_ur_add_problem, df_urec_add_problem, df_chain_add_problem,
+       df_ri_add_problem): Processes flags in uniform manner.
+       (df_ru_alloc, df_ru_local_compute, df_ru_confluence_n, df_ru_free,
+       df_ru_dump, df_rd_local_compute, df_rd_confluence_n, df_rd_free,
+       df_rd_dump, df_urec_free_bb_info): Formatting changes.
+       (df_ru_free_bb_info, df_ru_bb_local_compute, df_ru_dump,
+       df_rd_free_bb_info, df_rd_bb_local_compute_process_def,
+       df_rd_bb_local_compute, df_rd_dump, df_lr_free_bb_info,
+       df_lr_bb_local_compute, df_lr_local_compute, df_ur_free_bb_info,
+       df_ur_dump, df_urec_free_bb_info, df_urec_dump,
+       df_chain_create_bb, df_ri_bb_compute): Whitespace changes.
+       * modulo-sched.c (sms_schedule): Added flag parameter to calls.
+       * see.c (see_initialize_data): Ditto.
+       * final.c (rest_of_clean_state) Added regstack_completed.
+       * rtl.h (regstack_completed): Ditto.
+       * reg-stack.c (regstack_completed): Ditto.
+


Modified:
    trunk/gcc/ChangeLog

Comment 12 zadeck@gcc.gnu.org 2006-05-23 01:18:09 UTC
Subject: Bug 26855

Author: zadeck
Date: Tue May 23 01:17:29 2006
New Revision: 114010

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114010
Log:
2006-05-22  Kenneth Zadeck <zadeck@naturalbridge.com>

	PR rtl-optimization/26375
	PR rtl-optimization/26855
	* df-problems (df_ru_bb_local_compute_process_def): Removed update
	to gen set.
	(df_ru_bb_local_compute): Reversed statements and removed bogus
	comment explaining why they should be in wrong order.
	(df_ru_dump, df_rd_dump): Enhanced debug info.     
	* modulo-sched.c (sms_schedule, tree_opt_pass pass_sms): Enhanced
	debug info.       
	* ddg.c (add_deps_for_def): Converted use of reaching defs to
        reaching uses and fixed space problem.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ddg.c
    trunk/gcc/df-problems.c
    trunk/gcc/modulo-sched.c