From: Justin Seyster Date: Wed, 20 Oct 2010 18:48:36 +0000 (-0400) Subject: Correctly set types for constant values. X-Git-Tag: release-v1.0~33 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=9abd1ffc98d0aeb38cc2236f1afbdb1b55dfb726;p=interaspect.git Correctly set types for constant values. --- diff --git a/src/aop-header.c b/src/aop-header.c index 27d8264..4b35df9 100644 --- a/src/aop-header.c +++ b/src/aop-header.c @@ -171,11 +171,11 @@ get_param_types (va_list argp, int num_params, break; case ATA_INT_CST: va_arg (argp, int); - param_types[i] = aop_t_all_signed (); + param_types[i] = aop_t_signed32 (); break; case ATA_DOUBLE_CST: va_arg (argp, double); - param_types[i] = aop_t_all_fp (); + param_types[i] = aop_t_float64 (); break; case ATA_VOIDP_CST: va_arg (argp, void *); diff --git a/src/aop-weave.c b/src/aop-weave.c index 6a423db..7d08988 100644 --- a/src/aop-weave.c +++ b/src/aop-weave.c @@ -279,6 +279,10 @@ build_gcc_call (const char *func_name, tree return_type, break; case ATA_INT_CST: int_cst = va_arg (argp, int); + /* TODO: This assumes that int is 32-bit on all systems. + There are some systems where this isn't true (16-bit + machines, perhaps?), but I'm not sure how to get an + explicit 32-bit integer type node. */ new_arg = build_int_cst (integer_type_node, int_cst); VEC_safe_push (tree, heap, arg_list, new_arg); break; @@ -286,7 +290,7 @@ build_gcc_call (const char *func_name, tree return_type, float_cst = va_arg (argp, double); snprintf (float_buf, sizeof (float_buf), "%A", float_cst); real_from_string (&r, (const char *)float_buf); - new_arg = build_real (float_type_node, r); + new_arg = build_real (double_type_node, r); VEC_safe_push (tree, heap, arg_list, new_arg); break; case ATA_VOIDP_CST: