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] | |
}
+ /* Sometimes the C++ front-end generates a POINTER_PLUS_EXPR whose
+ operand 0 has type not trivailly convertible to the expression
+ type. We need to do a conversion. */
+ if (!useless_type_conversion_p (TREE_TYPE (*expr_p),
+ TREE_TYPE (TREE_OPERAND (*expr_p,
+ 0))))
+ {
+ tmp = fold_convert (TREE_TYPE (*expr_p),
+ TREE_OPERAND (*expr_p, 0));
+ *expr_p = build2 (POINTER_PLUS_EXPR, TREE_TYPE (*expr_p),
+ tmp, TREE_OPERAND (*expr_p, 1));
+ break;
+ }
+
/* FALLTHRU */
default:
Index: gcc/gcc/gimple.h
===================================================================
--- gcc/gcc/gimple.h (revision 135125)
+++ gcc/gcc/gimple.h (working copy)
@@ -1468,8 +1468,8 @@ gimple_call_return_type (const_gimple gs
tree fn = gimple_call_fn (gs);
tree type = TREE_TYPE (fn);
- /* See through pointer to functions. */
- if (TREE_CODE (type) == POINTER_TYPE)
+ /* See through pointer or reference to functions. */
+ if (TREE_CODE (type) == POINTER_TYPE || TREE_CODE (type) == REFERENCE_TYPE)
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |