public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Jim Wilson <wilson@tuliptree.org> To: wilson@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c/7871: ICE on legal code, global register variables problems Date: Mon, 10 Mar 2003 05:16:00 -0000 [thread overview] Message-ID: <20030310051601.10058.qmail@sources.redhat.com> (raw) The following reply was made to PR c/7871; it has been noted by GNATS. From: Jim Wilson <wilson@tuliptree.org> To: Richard Henderson <rth@redhat.com> Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, rz@linux-m68k.org, wilson@gcc.gnu.org Subject: Re: c/7871: ICE on legal code, global register variables problems Date: 10 Mar 2003 00:16:23 -0500 Let me recap a bit. The current code calls mark_set_1 (...CLOBBER...) and mark_used_regs. This causes CALL_INSNs to get a REG_UNDEAD note for a global_reg, which confuses combine into deleting the insn that initializes the global_reg. If I change this to mark_set_1 (...SET...), then there are no REG_DEAD/REG_UNUSED notes which is correct. However, there are LOG_LINKS from the insn that sets the global_reg to the CALL_INSN, and from the CALL_INSN to the insn that uses the global_reg. This causes combine to merge the 3 instructions together, and the result is that the first insn that sets the global_reg gets simplified away. This could perhaps be fixed by modifying combine to know that calls and global_regs are special. If I avoid calling mark_set_1, then there are no REG_DEAD/REG_UNUSED notes, but there is still a LOG_LINK from the first insn that sets the global_reg to the CALL_INSN. When combine merges an unrelated insn into the CALL_INSN, it sees a LOG_LINK that doesn't appear to belong on the CALL_INSN, so it moves it to the next insn which uses the global_reg. Combine then merges two instructions that set/use the global_reg, and the first global_reg set before the call disappears again. Thus it seems that in order to get the right behavior, we need to avoid adding any REG_NOTES or LOG_LINKS for global_regs. I had to go back to gcc-2.95.1 to find a compiler that worked for my two testcases, and it has this behavior. The change that broke it is: 2000-04-07 Richard Henderson <rth@cygnus.com> * flow.c (loop_depth): Remove. (reg_next_use, cc0_live, mem_set_list): Replace with ... ... (mark_set_reg): Break out of mark_set_1. ... I didn't manage to find the mail message for this patch. This command cvs diff -p -r 1.247 -r 1.248 flow.c will show you the patch if you want to look at it. This is a large change that was mostly reorganizing code, but another thing it does is delete one line of code in mark_set_1 that handles global_regs like the frame pointer and arg pointer register. If I re-add this one line of code, then both testcases I have start working again. I am off on a trip, so it will be a while before I am able to continue working on this. 2003-03-10 James E Wilson <wilson@tuliptree.org> * flow.c (mark_set_1): Handle global_regs like the frame pointer. Index: flow.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/flow.c,v retrieving revision 1.549 diff -p -r1.549 flow.c *** flow.c 28 Feb 2003 10:11:47 -0000 1.549 --- flow.c 10 Mar 2003 05:05:08 -0000 *************** mark_set_1 (pbi, code, reg, cond, insn, *** 2709,2714 **** --- 2709,2715 ---- #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && ! (regno_first == ARG_POINTER_REGNUM && fixed_regs[regno_first]) #endif + && ! (regno_first < FIRST_PSEUDO_REGISTER && global_regs[regno_first]) ) { int some_was_live = 0, some_was_dead = 0;
next reply other threads:[~2003-03-10 5:16 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-03-10 5:16 Jim Wilson [this message] -- strict thread matches above, loose matches on Subject: below -- 2003-05-02 14:16 Richard Zidlicky 2003-05-02 12:26 Richard Zidlicky 2003-05-01 6:06 Jim Wilson 2003-04-06 19:46 Jim Wilson 2003-04-02 20:56 Richard Zidlicky 2003-02-28 16:46 Jim Wilson 2003-02-28 5:56 Richard Henderson 2003-02-28 3:26 Jim Wilson 2003-02-28 3:02 wilson 2002-12-14 12:56 Richard Zidlicky 2002-09-09 14:36 Richard Zidlicky
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20030310051601.10058.qmail@sources.redhat.com \ --to=wilson@tuliptree.org \ --cc=gcc-prs@gcc.gnu.org \ --cc=wilson@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).