Getting the following testsuite failures on ppc-linux:
FAIL: gcc.dg/vect/vect-30.c execution test
FAIL: gcc.dg/vect/vect-8.c execution test

These failures seem to be related to alignment - when the array types are 
changed from float to afloat:
typedef float afloat __attribute__ ((__aligned__(16)));
the tests pass ok.

When compiling the original version, the vectorizer forces the alignment of 
these arrays:

      if (vect_debug_details (NULL))
        fprintf (dump_file, "force alignment");
      DECL_ALIGN (base) = TYPE_ALIGN (vectype);
      DECL_USER_ALIGN (base) = TYPE_ALIGN (vectype);

The tree dump files generated in both cases (float and afloat) looks identical,
as well as the RTL dumps; in both cases we have the following vector load/store 
generated (note the A128): 

(insn:TI 44 43 47 3 (set (reg:V4SF 77 0 [151])
        (mem:V4SF (reg/f:SI 11 11 [orig:130 ivtmp.55 ] [130]) [4 S16 A128])) 
482 {altivec_lvx_4sf} (nil)
    (expr_list:REG_EQUIV (mem:V4SF (reg/f:SI 9 9 [orig:129 ivtmp.65 ] [129]) [4 
S16 A128])
        (nil)))

(insn:TI 45 47 48 3 (set (mem:V4SF (reg/f:SI 9 9 [orig:129 ivtmp.65 ] [129]) [4 
S16 A128])
        (reg:V4SF 77 0 [151])) 486 {altivec_stvx_4sf} (insn_list:REG_DEP_TRUE 
44 (nil))
    (nil))

Yet the version with afloats runs correctly, and the original version aborts.

Possible places to look into:
- vect_can_force_dr_alignment_p is wrong?
- PREFERRD_STACK_BOUNDARY != STACK_BOUNDARY (not the case here)
- setting DECL_USER_ALIGN/DECL_ALIGN is not enough?
- the decl alignment attribute not propagated to RTL? (looks like it is)
- assembler problem?

This may be related to PR17589.

I can send a patch that changes floats to afloats, as a temporary fix.

-- 
           Summary: execution failure in vect-[8,30].c on ppc-linux
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dorit at il dot ibm dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-suse-linux
  GCC host triplet: powerpc-suse-linux
GCC target triplet: powerpc-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18173

Reply via email to