This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PR 40049, prevent garbage collect errors on machines with vector/vector shift


This patch fixes PR 40049, so that the correct tree/types are used when the
compiler is converting a vector << scalar shift into a vector << vector shift
for the machines that only have vector << vector shift (powerpc, spu -- the
x86_64 sse5 instruction set also has vector << vector shifts, but since they
also have vector << scalar shifts, they won't run into the situation as much).

Ultimately, this is due to vect_get_vec_def_for_operand creating the vector
from the scalar, and the type is incorrect in the shift case.  In particular,
shifts and rotates are unusual, in that they are binary operators, but the
types of the left and right sides are not identical (the right side is int).
Originally, I fixed it in vect_get_vec_df_for_operand, but it was suggested
that it was better to fix it in a more targetted approach.  I rewrote the
patch originally to just convert the type of operand, but in some cases, it
fails the simple_use test if the operand is loop invariant, but not a
constant.  So my third patch creates the constructor directly for that case.

I did bootstrap/make check on both x86_64 and powerpc64-linux.  On the x86_64
there are no regressions or improvements in the tests.  On the powerpc side,
testcase gcc.dg/vect/ggc-pr37574.c which had regressed is now passing.  Since
this testcase shows up the bug, I did not write up a new test case for the
compiler.

Is this patch ok to apply?

-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com

Attachment: gcc-vectshift.patch03
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]