------- Comment #13 from roger at eyesopen dot com  2005-12-04 18:06 -------
This bug has been fixed, and not just hidden.  Jeff Law's proposed solution to
this problem http://gcc.gnu.org/ml/gcc/2002-01/msg01872.html which was proposed
in January 2002, was contained as part of Jeff/HP's patch of April 2004 (which
is subversion revision 51785).

2002-04-03  Jeffrey A Law  ([EMAIL PROTECTED])
            Hans-Peter Nilsson  <[EMAIL PROTECTED]>

        * combine.c (simplify_comparison): Avoid narrowing a comparison
        with a paradoxical subreg when doing so would drop signficant bits.

This explains why no-one was has been able to reproduce the problem since that
date, and assumed that it was hidden (had gone latent) by an unrelated change.
Since then that solution has been corrected/improved further by Ulrich in
revision 70785.

2003-08-25  Ulrich Weigand  <[EMAIL PROTECTED]>

        * combine.c (simplify_comparison): Re-enable widening of comparisons
        with non-paradoxical subregs of non-REG expressions.


Alan Modra's (self-described) "band-aid" patch was never ideal.  It's not
unreasonable for combine to eliminate an AND expression with a read from
memory, if the paradoxical subreg semantics for the target imply zero
extension.
It's the later "unsafe" simplification of the comparison that was at fault.
Hence the current situation where simplify_comparison has been fixed, and
we don't have to needlessly disable a useful optimization with Alan's patch
is the most appropriate outcome.  Alan's work-around would have been suitable
for a release branch, if we didn't yet have the correct fix or such a fix
was too intrusive.


-- 

roger at eyesopen dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |roger at eyesopen dot com
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5169

Reply via email to