diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 42ad20e15fde7275a4f5ab919ac012466f67262a..8c98429a2f3a0c43b377b63067e8169140758dd4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2009-11-05 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/utils.c (gnat_type_for_mode): Handle vector modes. + 2009-11-05 Eric Botcazou <ebotcazou@adacore.com> * gcc-interface/trans.c (lvalue_required_p) <N_Unchecked_Conversion>: diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 6ee5a9128565fc9fa0efb545f6f9c6384395b097..c79dd4e7a65c98ab2225a9def9d3bc8c76114375 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -2177,16 +2177,28 @@ gnat_type_for_mode (enum machine_mode mode, int unsignedp) { if (mode == BLKmode) return NULL_TREE; - else if (mode == VOIDmode) + + if (mode == VOIDmode) return void_type_node; - else if (COMPLEX_MODE_P (mode)) + + if (COMPLEX_MODE_P (mode)) return NULL_TREE; - else if (SCALAR_FLOAT_MODE_P (mode)) + + if (SCALAR_FLOAT_MODE_P (mode)) return float_type_for_precision (GET_MODE_PRECISION (mode), mode); - else if (SCALAR_INT_MODE_P (mode)) + + if (SCALAR_INT_MODE_P (mode)) return gnat_type_for_size (GET_MODE_BITSIZE (mode), unsignedp); - else - return NULL_TREE; + + if (VECTOR_MODE_P (mode)) + { + enum machine_mode inner_mode = GET_MODE_INNER (mode); + tree inner_type = gnat_type_for_mode (inner_mode, unsignedp); + if (inner_type) + return build_vector_type_for_mode (inner_type, mode); + } + + return NULL_TREE; } /* Return the unsigned version of a TYPE_NODE, a scalar type. */