aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-07-28 02:15:51 +0000
committerRichard Stallman <rms@gnu.org>1992-07-28 02:15:51 +0000
commit1ad409d2e1b2205f167efd8eed56e5275f707c13 (patch)
treeae67e3bb21e58a1400b56ec8cc7d1cebb8f7d11e /gcc
parent95edfef236ff9bf3702d97718729a213e843cfd8 (diff)
downloadgcc-1ad409d2e1b2205f167efd8eed56e5275f707c13.zip
gcc-1ad409d2e1b2205f167efd8eed56e5275f707c13.tar.gz
gcc-1ad409d2e1b2205f167efd8eed56e5275f707c13.tar.bz2
(build_conditional_expr): Compare using TYPE_MAIN_VARIANT.
From-SVN: r1695
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-typeck.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index ec984d4..ac8e48e 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -3454,8 +3454,13 @@ build_conditional_expr (ifexp, op1, op2)
/* Quickly detect the usual case where op1 and op2 have the same type
after promotion. */
- if (type1 == type2)
- result_type = type1;
+ if (TYPE_MAIN_VARIANT (type1) == TYPE_MAIN_VARIANT (type2))
+ {
+ if (type1 == type2)
+ result_type = type1;
+ else
+ result_type = TYPE_MAIN_VARIANT (type1);
+ }
else if ((code1 == INTEGER_TYPE || code1 == REAL_TYPE)
&& (code2 == INTEGER_TYPE || code2 == REAL_TYPE))
{