+ /* atan(0.0) = 0.0 */
+ return i_mapper_zero_to_zero(call, ctx, FS_OPT_RTS_ATAN);
+} /* i_mapper_atan */
+
+/* A mapper for the floating point sinh. */
+int i_mapper_sinh(ir_node *call, void *ctx) {
+ /* sinh(0.0) = 0.0 */
+ return i_mapper_zero_to_zero(call, ctx, FS_OPT_RTS_SINH);
+} /* i_mapper_sinh */
+
+/* A mapper for the floating point cosh. */
+int i_mapper_cosh(ir_node *call, void *ctx) {
+ /* cosh(0.0) = 1.0, cosh(-x) = x */
+ return i_mapper_symmetric_zero_to_one(call, ctx, FS_OPT_RTS_COSH);
+} /* i_mapper_cosh */
+
+/* A mapper for the floating point tanh. */
+int i_mapper_tanh(ir_node *call, void *ctx) {
+ /* tanh(0.0) = 0.0 */
+ return i_mapper_zero_to_zero(call, ctx, FS_OPT_RTS_TANH);
+} /* i_mapper_tanh */
+
+/**
+ * Return the const entity that is accessed through the pointer ptr or
+ * NULL if there is no entity (or the entity is not constant).
+ *
+ * @param ptr the pointer
+ */
+static ir_entity *get_const_entity(ir_node *ptr) {
+ /* FIXME: this cannot handle constant strings inside struct initializers yet */
+ if (is_Global(ptr)) {
+ ir_entity *ent = get_Global_entity(ptr);
+
+ if (get_entity_variability(ent) == variability_constant) {
+ /* a constant entity */
+ return ent;
+ }
+ }
+ return NULL;
+} /* get_const_entity */
+
+/**
+ * Calculate the value of strlen if possible.
+ *
+ * @param ent the entity
+ * @param res_tp the result type
+ *
+ * @return a Const node containing the strlen() result or NULL
+ * if the evaluation fails
+ */
+static ir_node *eval_strlen(ir_entity *ent, ir_type *res_tp) {
+ ir_type *tp = get_entity_type(ent);
+ ir_mode *mode;
+ int i, n, len = -1;
+
+ if (! is_Array_type(tp))
+ return NULL;
+ tp = get_array_element_type(tp);
+ if (! is_Primitive_type(tp))
+ return NULL;
+ mode = get_type_mode(tp);
+
+ /* FIXME: This is too restrict, as the type char might be more the 8bits */
+ if (!mode_is_int(mode) || get_mode_size_bits(mode) != get_mode_size_bits(mode_Bs))
+ return NULL;
+
+ n = get_compound_ent_n_values(ent);
+ for (i = 0; i < n; ++i) {
+ ir_node *irn = get_compound_ent_value(ent, i);
+
+ if (! is_Const(irn))
+ return NULL;
+
+ if (is_Const_null(irn)) {
+ /* found the length */
+ len = i;
+ break;
+ }
+ }
+ if (len >= 0) {
+ tarval *tv = new_tarval_from_long(len, get_type_mode(res_tp));
+ return new_Const_type(tv, res_tp);
+ }
+ return NULL;
+} /* eval_strlen */
+
+/* A mapper for strlen */
+int i_mapper_strlen(ir_node *call, void *ctx) {
+ ir_node *s = get_Call_param(call, 0);
+ ir_entity *ent = get_const_entity(s);
+