This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR tree-optimization/58137
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 5 Sep 2013 12:25:08 +0200
- Subject: Re: [PATCH] Fix PR tree-optimization/58137
- Authentication-results: sourceware.org; auth=none
- References: <DUB122-W21C696D05E8CBB274B12E4E4430 at phx dot gbl> <CAFiYyc0TJyPoYc6FrS-OVR0VybWMJA3P76P3NSfuUi87STi96A at mail dot gmail dot com> <DUB122-W505BBD7A3159E2EDE398E7E4300 at phx dot gbl> <CAFiYyc3H-+4mdm-Oi6MaLuikZzzrPmEnCZc23q3GBoECFMmCWw at mail dot gmail dot com> <DUB122-W13DEE0725D16F2B5FCD215E4330 at phx dot gbl>
On Thu, Sep 5, 2013 at 11:43 AM, Bernd Edlinger
> On Tue, 3 Sep 2013 10:38:33, Richard Biener wrote:
>> I'd rather go with the simple fix as the issue in forwprop is at least
>> latent. We can
>> improve on the code-gen as followup where I believe handling of
>> would need to be added (that we avoid POINTER_PLUS_EXPR for vectors is a bug).
>> That can be done in a way to cover the vector case properly. Or
>> finally properly
>> use POINTER_PLUS_EXPR for vectors or make the vectorizer not use pointer
>> types but a corresponding unsigned integer type for them (that would also fix
>> the original bug of course). Like with (untested)
>> Index: gcc/tree-vect-stmts.c
>> --- gcc/tree-vect-stmts.c (revision 202196)
>> +++ gcc/tree-vect-stmts.c (working copy)
>> @@ -6179,8 +6179,7 @@ get_vectype_for_scalar_type_and_size (tr
>> corresponding to that mode. The theory is that any use that
>> would cause problems with this will disable vectorization anyway. */
>> else if (!SCALAR_FLOAT_TYPE_P (scalar_type)
>> - && !INTEGRAL_TYPE_P (scalar_type)
>> - && !POINTER_TYPE_P (scalar_type))
>> + && !INTEGRAL_TYPE_P (scalar_type))
>> scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1);
>> /* We can't build a vector type of elements with alignment bigger than
>> actually that would be my preference here ...
> this would cause an ICE in test case 20000629-1.c...
Well, that's easily fixable.
> So removing the pointer of vectors is not an option.
Let me nevertheless try this.
>>>> The real fix is of course to make vector pointer operations properly
>>>> use POINTER_PLUS_EXPR ...
> Okay I can do what you want, and use POINTER_PLUS_EXPR for
> vectors of pointers, and do the constant folding in assocate_pointerplus.
> This way we get exactly the same code as before. It may be even possible
> that this constant folding can improve something with scalars.
> Bootstrapped and regression tested on x86_64-unknown-linux-gnu.
> OK for trunk?