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] Fix PR 32230 - check that dr's base is not a constant


The testcase in PR32230 contains the following data-ref:

*(1B + (i * 4))

The dr created for it is:
        base_address: 0B
        offset from base address: 0
        constant offset from base address: 1
        step: 4
        aligned to: 128
        base_object: *0B
        symbol tag: SMT.5

The vectorizer tries to create a vector pointer for the base address and
fails here, since the base address is OB (the segfault occurs when the
vectorizer attempts to add an empty stmt).

This patch adds a check in dr analysis that base address is not
INTEGER_CONST. (It is also possible to check the base address in the
vectorizer. I chose to add the check in the dr analysis, since I think we
don't want to optimize such code anyway (not only in the vectorizer)).

Bootstrapped on ppc-linux and (with vectorization enabled) on i686-linux.
Now testing on i686-linux.
O.K. for mainline once the testing completes?

Thanks,
Ira

:ADDPATCH SSA:

ChangeLog:

      PR tree-optimization/32230
      * tree-data-ref.c (dr_analyze_innermost): Fail if base is a constant.

(See attached file: pr32230.txt)

Attachment: pr32230.txt
Description: Text document


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