summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-03 15:50:42 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-03 15:50:42 +0000
commita4521f7eeff392adcac2bcb42c6131cf39e02705 (patch)
tree4747d3f159f5acd4eb140b04448e4887f12b654e /gcc
parentc12658407f04b6b664cd69a5142b30e79f2feee0 (diff)
downloadgcc-a4521f7eeff392adcac2bcb42c6131cf39e02705.tar.gz
* expr.c (store_expr): If get_signed_or_unsigned_type doesn't yield
an appropriate type, use the mode instead. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123477 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expr.c16
2 files changed, 18 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0a56ebc63e2..e3b491aea99 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-03 Richard Henderson <rth@redhat.com>
+
+ * expr.c (store_expr): If get_signed_or_unsigned_type doesn't yield
+ an appropriate type, use the mode instead.
+
2007-04-03 Richard Sandiford <richard@codesourcery.com>
* config.gcc (mips-wrs-vxworks): Add vx-common.h to tm_file.
diff --git a/gcc/expr.c b/gcc/expr.c
index 653eb56ce96..77cc44a83d3 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4383,9 +4383,19 @@ store_expr (tree exp, rtx target, int call_param_p)
{
if (TYPE_UNSIGNED (TREE_TYPE (exp))
!= SUBREG_PROMOTED_UNSIGNED_P (target))
- exp = fold_convert
- (get_signed_or_unsigned_type
- (SUBREG_PROMOTED_UNSIGNED_P (target), TREE_TYPE (exp)), exp);
+ {
+ /* Some types, e.g. Fortran's logical*4, won't have a signed
+ version, so use the mode instead. */
+ tree ntype
+ = (get_signed_or_unsigned_type
+ (SUBREG_PROMOTED_UNSIGNED_P (target), TREE_TYPE (exp)));
+ if (ntype == NULL)
+ ntype = lang_hooks.types.type_for_mode
+ (TYPE_MODE (TREE_TYPE (exp)),
+ SUBREG_PROMOTED_UNSIGNED_P (target));
+
+ exp = fold_convert (ntype, exp);
+ }
exp = fold_convert (lang_hooks.types.type_for_mode
(GET_MODE (SUBREG_REG (target)),