diff options
author | John David Anglin <dave.anglin@nrc-cnrc.gc.ca> | 2005-08-16 02:20:40 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2005-08-16 02:20:40 +0000 |
commit | f60c951c844dff1d3a5cca19d35bb57d404ff6cc (patch) | |
tree | 5246fae20e2ea5ace9d99edf2218261f1d06abfa /gcc | |
parent | 5b5dc475889df0f4a8dfcdd6e73d4099a32ce7cc (diff) | |
download | gcc-f60c951c844dff1d3a5cca19d35bb57d404ff6cc.zip gcc-f60c951c844dff1d3a5cca19d35bb57d404ff6cc.tar.gz gcc-f60c951c844dff1d3a5cca19d35bb57d404ff6cc.tar.bz2 |
re PR middle-end/23369 (build_range_check generates wrong code for funcptr comparison)
PR middle-end/23369
* fold-const.c (build_range_check): Disable optimization for function
pointer expressions on targets that require function pointer
canonicalization.
From-SVN: r103145
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fold-const.c | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f4960d60..93257ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-08-15 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + + PR middle-end/23369 + * fold-const.c (build_range_check): Disable optimization for function + pointer expressions on targets that require function pointer + canonicalization. + 2005-08-15 Ulrich Weigand <uweigand@de.ibm.com> * simplify-rtx.c (simplify_const_relational_operation): When diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 19b5459..84dad8b 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3929,6 +3929,15 @@ build_range_check (tree type, tree exp, int in_p, tree low, tree high) tree etype = TREE_TYPE (exp); tree value; +#ifdef HAVE_canonicalize_funcptr_for_compare + /* Disable this optimization for function pointer expressions + on targets that require function pointer canonicalization. */ + if (HAVE_canonicalize_funcptr_for_compare + && TREE_CODE (etype) == POINTER_TYPE + && TREE_CODE (TREE_TYPE (etype)) == FUNCTION_TYPE) + return NULL_TREE; +#endif + if (! in_p) { value = build_range_check (type, exp, 1, low, high); |