This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/27497] New: store ccp does not handle constant aggregate refs of STRING_CSTs
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 May 2006 15:51:21 -0000
- Subject: [Bug tree-optimization/27497] New: store ccp does not handle constant aggregate refs of STRING_CSTs
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Testcase:
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
static const char f[3] = "?";
int foo()
{
int i = 0;
return f[i] != '?';
}
/* { dg-final { scan-tree-dump "return 0;" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
Problem is two-fold, for once, fold_const_aggregate_ref does not handle
STRING_CST, second, evaluate_stmt triggers the likelyvalue == CONSTANT
path only, and ccp_fold does not call fold_const_aggregate_ref.
RTL handles this. I have a patch.
--
Summary: store ccp does not handle constant aggregate refs of
STRING_CSTs
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: missed-optimization, TREE
Severity: enhancement
Priority: P3
Component: tree-optimization
AssignedTo: rguenth at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27497