do not emit stabs for array types with unknown bounds
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 21 Jun 2007 12:31:57 +0000 (12:31 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 21 Jun 2007 12:31:57 +0000 (12:31 +0000)
[r14682]

ir/be/bestabs.c

index 1d27373..f08586a 100644 (file)
@@ -341,11 +341,14 @@ static void gen_array_type(wenv_t *env, ir_type *tp) {
 
        for (i = 0; i < n; ++i) {
                int dim = perm[i];
-               long min = get_array_lower_bound_int(tp, dim);
-               long max = get_array_upper_bound_int(tp, dim);
 
-               /* FIXME r1 must be integer type, but seems to work for now */
-               fprintf(h->f, "r1;%ld;%ld;", min, max-1);
+               if (is_Const(get_array_lower_bound(tp, dim)) && is_Const(get_array_upper_bound(tp, dim))) {
+                       long min = get_array_lower_bound_int(tp, dim);
+                       long max = get_array_upper_bound_int(tp, dim);
+
+                       /* FIXME r1 must be integer type, but seems to work for now */
+                       fprintf(h->f, "r1;%ld;%ld;", min, max-1);
+               }
        }
 
        type_num = get_type_number(h, etp);