On 05/10/2016 03:06 PM, Dominik Vogt wrote:
+ int cost_of_and;
+ int cost_of_zero_ext;
+
+ cost_of_and = rtx_cost (x, mode, in_code, 1, speed_p);
+ cost_of_zero_ext = rtx_cost (temp, mode, in_code, 1, speed_p);
+ if (cost_of_zero_ext <= cost_of_and)
Earlier in the discussion you mentioned the intention to remove these
costs. Nothing else in the function does cost calculations - maybe you
can try placing a gcc_unreachable into the case where the costs would
prevent the transformation to see if it ever triggers.
+/* Test whether an AND mask or'ed with the know zero bits that equals a mode
+ mask is a candidate for zero extendion. */
+
+/* Note: This test requires that char, int and long have different sizes and
the
+ target has a way to do 32 -> 64 bit zero extension other than AND. Targets
+ that fail the test because they do not satisfy these preconditions can skip
+ it. */
Hmm, maybe place copies into a few gcc.target subdirectories instead? Or
add a whitelist of targets (x86, power, aarch64 maybe)?
+/* { dg-do compile { target lp64 } } */
I suspect this should be
/* { dg-do compile } */
/* { dg-require-effective-target lp64 } */
Bernd