summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-10 12:02:34 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-10 12:02:34 +0000
commit5d122ee86607832e04687dacbb1922114aa91b43 (patch)
treeb7f307b27630a0ee41a33275cbadf6f9e3bcb1b6
parentbb423b868b81eefd8c5e39b850bed02425c9acc7 (diff)
downloadgcc-5d122ee86607832e04687dacbb1922114aa91b43.tar.gz
* tree.c (get_unwidened): Reorder conditions so that the null pointer
check is done first. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75639 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a4756335357..13ee5f6b070 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-10 Richard Sandiford <rsandifo@redhat.com>
+
+ * tree.c (get_unwidened): Reorder conditions so that the null pointer
+ check is done first.
+
2004-01-09 Eric Christopher <echristo@redhat.com>
* toplev.c (rest_of_handle_cfg): Add reg_scan pass
diff --git a/gcc/tree.c b/gcc/tree.c
index b252a67c354..8fffffdca6d 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4123,10 +4123,10 @@ get_unwidened (tree op, tree for_type)
The resulting extension to its nominal type (a fullword type)
must fit the same conditions as for other extensions. */
- if (INT_CST_LT_UNSIGNED (TYPE_SIZE (type), TYPE_SIZE (TREE_TYPE (op)))
+ if (type != 0
+ && INT_CST_LT_UNSIGNED (TYPE_SIZE (type), TYPE_SIZE (TREE_TYPE (op)))
&& (for_type || ! DECL_BIT_FIELD (TREE_OPERAND (op, 1)))
- && (! uns || final_prec <= innerprec || unsignedp)
- && type != 0)
+ && (! uns || final_prec <= innerprec || unsignedp))
{
win = build (COMPONENT_REF, type, TREE_OPERAND (op, 0),
TREE_OPERAND (op, 1));