mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-23 19:03:59 +08:00
tree-optimization/113602 - datarefs of non-addressables
We can end up creating ADDR_EXPRs of non-addressable entities during for example vectorization. The following plugs this in data-ref analysis when that would create such invalid ADDR_EXPR as part of analyzing the ref structure. PR tree-optimization/113602 * tree-data-ref.cc (dr_analyze_innermost): Fail when the base object isn't addressable. * gcc.dg/pr113602.c: New testcase.
This commit is contained in:
parent
4b5650acb3
commit
f9b143d239
10
gcc/testsuite/gcc.dg/pr113602.c
Normal file
10
gcc/testsuite/gcc.dg/pr113602.c
Normal file
@ -0,0 +1,10 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target bitint575 } */
|
||||
/* { dg-options "-O2 -fno-tree-loop-optimize" } */
|
||||
|
||||
_BitInt(503)
|
||||
f(void)
|
||||
{
|
||||
register _BitInt(503) r asm(""); /* { dg-error "invalid" } */
|
||||
return r;
|
||||
}
|
@ -1182,7 +1182,12 @@ dr_analyze_innermost (innermost_loop_behavior *drb, tree ref,
|
||||
base = TREE_OPERAND (base, 0);
|
||||
}
|
||||
else
|
||||
base = build_fold_addr_expr (base);
|
||||
{
|
||||
if (may_be_nonaddressable_p (base))
|
||||
return opt_result::failure_at (stmt,
|
||||
"failed: base not addressable.\n");
|
||||
base = build_fold_addr_expr (base);
|
||||
}
|
||||
|
||||
if (in_loop)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user