aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-04-11 09:22:29 -0700
committerRichard Henderson <rth@gcc.gnu.org>2003-04-11 09:22:29 -0700
commita46666a9508860fd72ac9d592956d8364302f154 (patch)
tree1cb23927181d5252d9655bc7e20fc97b620c0e9d /gcc
parent6d2f9dd377ee9d9af94c58097d3511192eded91c (diff)
downloadgcc-a46666a9508860fd72ac9d592956d8364302f154.zip
gcc-a46666a9508860fd72ac9d592956d8364302f154.tar.gz
gcc-a46666a9508860fd72ac9d592956d8364302f154.tar.bz2
re PR c/10201 ([IA64] ICE in int_mode_for_mode, at stor-layout.c)
PR c/10201 * expr.c (expand_expr): Move DECL_RTL frobbing ... * stor-layout.c (layout_decl): ... here. From-SVN: r65467
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/expr.c16
-rw-r--r--gcc/stor-layout.c12
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030410-1.c27
4 files changed, 46 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0df55f0..ea6055b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2003-04-11 Richard Henderson <rth@redhat.com>
+
+ PR c/10201
+ * expr.c (expand_expr): Move DECL_RTL frobbing ...
+ * stor-layout.c (layout_decl): ... here.
+
2003-04-11 James A. Morrison <ja2morri@uwaterloo.ca>
* doc/invoke.texi: Eliminate extra white-space caused by
diff --git a/gcc/expr.c b/gcc/expr.c
index a2b547e..3d8903d 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -6714,21 +6714,7 @@ expand_expr (exp, target, tmode, modifier)
but the type is complete now, lay out the decl now. */
if (DECL_SIZE (exp) == 0 && COMPLETE_TYPE_P (TREE_TYPE (exp))
&& (TREE_STATIC (exp) || DECL_EXTERNAL (exp)))
- {
- rtx value = DECL_RTL_IF_SET (exp);
-
- layout_decl (exp, 0);
-
- /* If the RTL was already set, update its mode and memory
- attributes. */
- if (value != 0)
- {
- PUT_MODE (value, DECL_MODE (exp));
- SET_DECL_RTL (exp, 0);
- set_mem_attributes (value, exp, 1);
- SET_DECL_RTL (exp, value);
- }
- }
+ layout_decl (exp, 0);
/* ... fall through ... */
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 106c7c6..c592fa4 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -390,6 +390,7 @@ layout_decl (decl, known_align)
{
tree type = TREE_TYPE (decl);
enum tree_code code = TREE_CODE (decl);
+ rtx rtl = NULL_RTX;
if (code == CONST_DECL)
return;
@@ -397,6 +398,8 @@ layout_decl (decl, known_align)
&& code != TYPE_DECL && code != FIELD_DECL)
abort ();
+ rtl = DECL_RTL_IF_SET (decl);
+
if (type == error_mark_node)
type = void_type_node;
@@ -542,6 +545,15 @@ layout_decl (decl, known_align)
larger_than_size);
}
}
+
+ /* If the RTL was already set, update its mode and mem attributes. */
+ if (rtl)
+ {
+ PUT_MODE (rtl, DECL_MODE (decl));
+ SET_DECL_RTL (decl, 0);
+ set_mem_attributes (rtl, decl, 1);
+ SET_DECL_RTL (decl, rtl);
+ }
}
/* Hook for a front-end function that can modify the record layout as needed
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030410-1.c b/gcc/testsuite/gcc.c-torture/compile/20030410-1.c
new file mode 100644
index 0000000..9127ede
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030410-1.c
@@ -0,0 +1,27 @@
+/* PR 10201 */
+
+extern struct _zend_compiler_globals compiler_globals;
+typedef struct _zend_executor_globals zend_executor_globals;
+extern zend_executor_globals executor_globals;
+
+typedef struct _zend_ptr_stack {
+ int top;
+ void **top_element;
+} zend_ptr_stack;
+struct _zend_compiler_globals {
+};
+struct _zend_executor_globals {
+ int *uninitialized_zval_ptr;
+ zend_ptr_stack argument_stack;
+};
+
+static inline void safe_free_zval_ptr(int *p)
+{
+ if (p!=(executor_globals.uninitialized_zval_ptr)) {
+ }
+}
+zend_executor_globals executor_globals;
+static inline void zend_ptr_stack_clear_multiple(void)
+{
+ executor_globals.argument_stack.top -= 2;
+}