fixed output of arm_emit_shift()
[libfirm] / ir / be / bestabs.c
index 1821838..f08586a 100644 (file)
@@ -1,12 +1,31 @@
-/**
- * Stabs support.
+/*
+ * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
  *
- * @author Michael Beck
- * @date   11.9.2006
- * @cvsid  $Id$
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
+/**
+ * @file
+ * @brief   Stabs support.
+ * @author  Michael Beck
+ * @date    11.9.2006
+ * @version $Id$
  */
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
 #include <stdio.h>
@@ -15,9 +34,7 @@
 
 #include "obst.h"
 #include "irprog.h"
-#include "entity.h"
 #include "irgraph.h"
-#include "typewalk.h"
 #include "tv.h"
 #include "xmalloc.h"
 #include "pmap.h"
@@ -324,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);