illegally shared subreg
Geoff Keating
geoffk@geoffk.org
Fri Oct 11 12:04:00 GMT 2002
> Date: Fri, 11 Oct 2002 10:31:40 -0400 (EDT)
> From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
> Geoff/Stuart,
>
> This patch:
>
> > 2002-10-10 Stuart Hastings <stuart@apple.com>
> >
> > * cse.c (struct cse_reg_info): Add subreg_ticked.
> > (SUBREG_TICKED): New.
> > (get_cse_reg_info): Initialize SUBREG_TICKED.
> > (mention_regs): Use it.
> > (invalidate): Set SUBREG_TICKED.
> > (invalidate_for_call): Likewise.
> > (addr_affects_sp_p): Likewise.
>
> can't be right. It causes these new warnings:
>
> > cse.c:1226: warning: comparison between pointer and integer
> > cse.c:1233: warning: assignment makes integer from pointer without a cast
>
> because you've got an int on one side and an rtx on the other.
> (Irix6-cc gets a hard error on these lines instead of a warning.)
*sigh*. The code would have worked in nearly all circumstances, since
REGs are usually shared. I will commit a patch (following Graham's
suggestion) to fix the problem shortly.
> PS: I wish the regression checker would notice warning regressions to
> catch things like this. I.e. things that don't cause a bootstrap or
> testsuite failure, but which are clearly bugs. We've discussed
> strategies for implementing this without too much trouble in the past,
> I hope this example will encourage you to see that it's worthwhile. :-)
Yes. I'd really rather notice this sort of thing before it gets to
the regression tester, though, ideally with a build failure; there are
no circumstances under which 'assignment makes integer from pointer'
is an OK warning while bootstrapping GCC, and notice that both Stuart
and I both bootstrapped with this patch and didn't notice the warning.
--
- Geoffrey Keating <geoffk@geoffk.org>
More information about the Gcc-patches
mailing list