aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorDirk Mueller <dmueller@suse.de>2006-05-09 14:16:50 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2006-05-09 14:16:50 +0000
commitf9c3744b7f05d9e60ff8776111ad9049b55d863a (patch)
treee0ba9e9c343cc1cd57ef4f7f67500ebcf0e17982 /gcc/fold-const.c
parent2c790a28841f2a404f1f6e96d07041138583788a (diff)
downloadgcc-f9c3744b7f05d9e60ff8776111ad9049b55d863a.zip
gcc-f9c3744b7f05d9e60ff8776111ad9049b55d863a.tar.gz
gcc-f9c3744b7f05d9e60ff8776111ad9049b55d863a.tar.bz2
re PR middle-end/27498 (fold does not fold reads from constant static strings)
2006-05-09 Dirk Mueller <dmueller@suse.de> Richard Guenther <rguenther@suse.de> PR middle-end/27498 * fold-const.c (fold_read_from_constant_string): Relax check for matching types to matching modes. * gcc.dg/tree-ssa/pr27498.c: New testcase. Co-Authored-By: Richard Guenther <rguenther@suse.de> From-SVN: r113651
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 5671682..26e53c0 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -12220,7 +12220,7 @@ fold_read_from_constant_string (tree exp)
}
if (string
- && TREE_TYPE (exp) == TREE_TYPE (TREE_TYPE (string))
+ && TYPE_MODE (TREE_TYPE (exp)) == TYPE_MODE (TREE_TYPE (TREE_TYPE (string)))
&& TREE_CODE (string) == STRING_CST
&& TREE_CODE (index) == INTEGER_CST
&& compare_tree_int (index, TREE_STRING_LENGTH (string)) < 0