This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
ping: fix mem+32760 ICE on powerpc - introduce predicates weaker than mode_dependent_address_p
- From: Olivier Hainque <hainque at adacore dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Olivier Hainque <hainque at adacore dot com>
- Date: Fri, 25 May 2012 11:12:23 +0200
- Subject: ping: fix mem+32760 ICE on powerpc - introduce predicates weaker than mode_dependent_address_p
- References: <BA1263D3-5B7D-4764-A01A-70E49FC44CFD@adacore.com>
Hello,
Ping for the non-back-end parts of
http://gcc.gnu.org/ml/gcc-patches/2012-04/msg01668.html
David approved the rs6000 parts already (with adjustments to
comments, http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00368.html)
Thanks much in advance for your feedback,
Olivier
On Apr 26, 2012, at 11:30 , Olivier Hainque wrote:
...
> a number of places in the compiler use the
> mode_dependent_address_p predicate to actually check for weaker necesssary
> conditions. Typically, a few places need to check that a MEM access remains
> valid when just narrowing the mode, while mode_dependent_address_p tells if
> any mode change is valid.
>
> While this is of course generally safe, this has been causing endless troubles
> to the powerpc back-end which has apparently unique particularities related to
> altivec modes.
...
> The attached patch is a proposal to fix this, slightly generalized compared
> to the original one. The general idea is to allow for weaker predicates at
> the places where we need them.
>
> This is achieved by the introduction of a TARGET_MAY_NARROW_ACCESS target
> hook, which defaults to !mode_dependent_address_p and is redefined for
> powerpc. The patch uses this hook directly instead of the former predicate in
> a couple of places where this was the intent already, as well as new
> "valid_access_mode_change_p" function to direct to one or the or the other
> depending on provided original and destination modes.
>
> This provides a better match for actual internal needs, allows to get rid of
> the powerpc back-end twists (no need to lie in mode_dependent_address_p any
> more) and cures the observed internal compiler error.
...
> 2012-04-26 Olivier Hainque <hainque@adacore.com>
>
> * target.def (TARGET_MAY_NARROW_ACCESS_TO): New hook.
> * doc/tm.texi[.in] (TARGET_MAY_NARROW_ACCESS_TO): Document.
> * targhooks.c (default_may_narrow_access_to): Default implementation.
> * targhooks.h (default_may_narrow_access_to): Declare.
> * config/rs6000/rs6000.c (rs6000_may_narrow_access_to): Specific
> implementation.
> (rs6000_mode_dependent_address): Stop lying for + const_int.
> (rs6000_offsettable_memref_p): Adjust comments accordingly.
> * expr.c (convert_move): Use may_narrow_access_to instead of
> mode_dependent_address_p where appropriate.
> * recog.c (offsettable_address_addr_space_p): Likewise.
> (valid_access_mode_change_p): New function.
> * recog.h (valid_access_mode_change_p): Declare.
> * simplify-rtx.c (simplify_subreg): Use it instead of
> mode_dependent_address_p where appropriate.
>
> testsuite/
> * gcc.dg/offsetmem.c: New test.
>
> <narrow.dif>