This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: simplify_subreg aborts bad?
- To: dj at redhat dot com, gcc at gcc dot gnu dot org
- Subject: Re: simplify_subreg aborts bad?
- From: Jan Hubicka <jh at suse dot cz>
- Date: Wed, 27 Jun 2001 23:47:01 +0200
> In simplify-rtx.c in simplify_subreg, there are three aborts listed
> under "sanity checking". IMHO at least two of these should be return
> 0 and not abort, or all the places which call simplify_subreg need to
I donīt think so. At the moment, most of code still lives in the world
we do have word based subreg offsets. We canīt safely allow cases,
such as missaligned subregs w/o re-validating all the code.
> pre-validate the rtx they pass.
>
> combine_simplify_rtx tries to simplify all subregs *before* checking
> to see if the pattern is valid, and it's pretty much throwing patterns
> together at random. Since it isn't validating the patterns,
> simplify_subreg should be conservative about handling bogus patterns.
> In my case, combine tried to combine a subreg with a VOIDmode setcc
> precursor pattern (please don't say "you shouldn't do VOIDmode
> setcc's" because that's not my point).
But thats my belief. Combiner should create valid patterns, otherwise
we will get surprises in the code generation by writting pattern matching
ill defined thinks, such as subregs of VOIDmode.
It is easy to missinterpret ill defined patterns and we shouldnīt risk that.
In this case, the code IMO hit bug in setcc pattern returning VOIDmode.
> > if (byte % GET_MODE_SIZE (outermode)
> > || byte >= GET_MODE_SIZE (innermode))
> > abort ();
>
> Consider a machine with 16-bit registers, and this struct:
Yes, it may make sense to handle missaligned subregs, at least in case
simplification is possible.
But even the code inside simplify subreg is wrong to handle them,
cse contains another and reload rest.
Until this is fixed, such constructs needs to be refused.
Whole point under simplify_subreg is to commonize the code and make such
changes possible and safe. I am not done yet. Main missing part is the
simplification of constants, that is still dupplicated around operand_subword,
strict_low_part and other random places.
All those places messes thinks up when the subreg crosses word boundary,
sadly.
Right now I am waiting to catch exactly such cases, try to fix them and
let thinks settle down before more chnages in this area.
Honza