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]

gcse related bugfix Re: [bugs] Another ICE


> 
> Honza, 
> 
> you shouldn't have asked for more bugreports ;-).
> 
> Here's on more ICE - I'm trying to build a shared glibc.  The static
> glibc build fine.
> (insn 195 190 197 (set (reg:SI 95)
>         (subreg:SI (symbol_ref/v:DI ("xdigits.0")) 0)) -1 (nil)
>     (expr_list:REG_EQUAL (subreg:SI (symbol_ref/v:DI ("xdigits.0")) 0)
>         (nil)))
> inet_pton.c:217: Internal compiler error in extract_insn, at recog.c:2338
> Please submit a full bug report, with preprocessed source if appropriate.
> See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
> 
This bug took me really a lot of time.  The problem lies in gcse's
try_replace_reg, that creates reg_equal note using simplify_replace_rtx, that
don't create brand new copy of RTX on parts that hasn't been changed and since
subreg is not supported by it yet, the rtx remains same as the insn pattern,
creating an RTX sharing problem that brings inexpected problems later in cse
pass, that updates it's REG_EQUAL note to the form above, but as side effect
changes the pattern of insn w/o validating the change.

The fix is following one-liner I am attaching.

Richards: I would really love to invest my time in writing sane routines
for doing replacements in RTL, since this seems to be deadly needed.
Please would be possible for one of you to review the simplify_subreg patch,
as it is kind of first step in that direction?

I believe that new gcse code is on the branch.  I don't have non-x86_64
testcase in hands, so I probably can't validate the patch for inclusion.
But I would really love to see it considered.

Also the gcse dumps are wonderfully useless and completely missdirected me
while hunting the problem. Can't we create separate dump for the gcse itself,
the motion passes and the cse, jump run afterwards?

Honza

Mon May 14 14:28:25 CEST 2001  Jan Hubicka  <jh@suse.cz>

	* gcse.c (try_replace_reg): Avoid RTX sharing problem.

Index: gcse.c
===================================================================
RCS file: /home/cvs/Repository/gcc/gcc/gcse.c,v
retrieving revision 1.10
diff -c -3 -p -r1.10 gcse.c
*** gcse.c	2001/05/03 15:57:38	1.10
--- gcse.c	2001/05/14 11:24:25
*************** try_replace_reg (from, to, insn)
*** 4061,4067 ****
    /* If there is already a NOTE, update the expression in it with our
       replacement.  */
    else if (note != 0)
!     XEXP (note, 0) = simplify_replace_rtx (XEXP (note, 0), from, to);
  
    /* REG_EQUAL may get simplified into register.
       We don't allow that. Remove that note. This code ought
--- 4061,4067 ----
    /* If there is already a NOTE, update the expression in it with our
       replacement.  */
    else if (note != 0)
!     XEXP (note, 0) = copy_rtx (simplify_replace_rtx (XEXP (note, 0), from, to));
  
    /* REG_EQUAL may get simplified into register.
       We don't allow that. Remove that note. This code ought


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