+ case bk_gnu_builtin_va_end:
+ /* evaluate the argument of va_end for its side effects */
+ _expression_to_firm(call->arguments->expression);
+ return NULL;
+ case bk_gnu_builtin_frame_address: {
+ expression_t *const expression = call->arguments->expression;
+ bool val = fold_constant_to_bool(expression);
+ if (!val) {
+ /* the nice case */
+ return get_irg_frame(current_ir_graph);
+ } else {
+ /* get the argument */
+ ir_node *in[2];
+
+ in[0] = expression_to_firm(expression);
+ in[1] = get_irg_frame(current_ir_graph);
+ ir_type *tp = get_ir_type(function_type);
+ ir_node *irn = new_d_Builtin(dbgi, get_irg_no_mem(current_ir_graph), 2, in, ir_bk_frame_address, tp);
+ return new_Proj(irn, mode_P_data, pn_Builtin_1_result);
+ }
+ }
+ case bk_gnu_builtin_return_address: {
+ expression_t *const expression = call->arguments->expression;
+ ir_node *in[2];
+
+ in[0] = expression_to_firm(expression);
+ in[1] = get_irg_frame(current_ir_graph);
+ ir_type *tp = get_ir_type(function_type);
+ ir_node *irn = new_d_Builtin(dbgi, get_irg_no_mem(current_ir_graph), 2, in, ir_bk_return_address, tp);
+ return new_Proj(irn, mode_P_data, pn_Builtin_1_result);
+ }
+ case bk_gnu_builtin_ffs:
+ return gen_unary_builtin(ir_bk_ffs, call->arguments->expression, function_type, dbgi);
+ case bk_gnu_builtin_clz:
+ return gen_unary_builtin(ir_bk_clz, call->arguments->expression, function_type, dbgi);
+ case bk_gnu_builtin_ctz:
+ return gen_unary_builtin(ir_bk_ctz, call->arguments->expression, function_type, dbgi);
+ case bk_gnu_builtin_popcount:
+ case bk_ms__popcount:
+ return gen_unary_builtin(ir_bk_popcount, call->arguments->expression, function_type, dbgi);
+ case bk_gnu_builtin_parity:
+ return gen_unary_builtin(ir_bk_parity, call->arguments->expression, function_type, dbgi);
+ case bk_gnu_builtin_prefetch: {
+ call_argument_t *const args = call->arguments;
+ expression_t *const addr = args->expression;
+ ir_node *in[3];
+
+ in[0] = _expression_to_firm(addr);
+ if (args->next != NULL) {
+ expression_t *const rw = args->next->expression;
+
+ in[1] = _expression_to_firm(rw);
+
+ if (args->next->next != NULL) {
+ expression_t *const locality = args->next->next->expression;
+
+ in[2] = expression_to_firm(locality);
+ } else {
+ in[2] = new_Const_long(mode_int, 3);
+ }
+ } else {
+ in[1] = new_Const_long(mode_int, 0);
+ in[2] = new_Const_long(mode_int, 3);
+ }
+ ir_type *tp = get_ir_type(function_type);
+ ir_node *irn = new_d_Builtin(dbgi, get_store(), 3, in, ir_bk_prefetch, tp);
+ set_store(new_Proj(irn, mode_M, pn_Builtin_M));
+ return NULL;
+ }
+ case bk_gnu_builtin_object_size: {
+ /* determine value of "type" */
+ expression_t *type_expression = call->arguments->next->expression;
+ long type_val = fold_constant_to_int(type_expression);
+ type_t *type = function_type->function.return_type;
+ ir_mode *mode = get_ir_mode_arithmetic(type);
+ /* just produce a "I don't know" result */
+ ir_tarval *result = type_val & 2 ? get_mode_null(mode) :
+ get_mode_minus_one(mode);
+
+ return new_d_Const(dbgi, result);
+ }
+ case bk_gnu_builtin_trap:
+ case bk_ms__ud2:
+ {
+ ir_type *tp = get_ir_type(function_type);
+ ir_node *irn = new_d_Builtin(dbgi, get_store(), 0, NULL, ir_bk_trap, tp);
+ set_store(new_Proj(irn, mode_M, pn_Builtin_M));
+ return NULL;
+ }
+ case bk_ms__debugbreak: {
+ ir_type *tp = get_ir_type(function_type);
+ ir_node *irn = new_d_Builtin(dbgi, get_store(), 0, NULL, ir_bk_debugbreak, tp);
+ set_store(new_Proj(irn, mode_M, pn_Builtin_M));