1 /* Handle types for the GNU compiler for the Java(TM) language.
2 Copyright (C) 1996, 97-98, 1999 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.
21 Java and all Java-based marks are trademarks or registered trademarks
22 of Sun Microsystems, Inc. in the United States and other countries.
23 The Free Software Foundation is independent of Sun Microsystems, Inc. */
25 /* Written by Per Bothner <bothner@cygnus.com> */
32 #include "java-tree.h"
37 static tree convert_ieee_real_to_integer
PROTO ((tree
, tree
));
38 static tree parse_signature_type
PROTO ((const unsigned char **,
39 const unsigned char *));
42 extern struct obstack permanent_obstack
;
44 /* Set the type of the local variable with index SLOT to TYPE. */
47 set_local_type (slot
, type
)
51 int max_locals
= DECL_MAX_LOCALS(current_function_decl
);
52 int nslots
= TYPE_IS_WIDE (type
) ? 2 : 1;
53 if (slot
< 0 || slot
+ nslots
- 1 >= max_locals
)
54 fatal ("invalid local variable index");
55 type_map
[slot
] = type
;
57 type_map
[++slot
] = void_type_node
;
60 /* Convert an IEEE real to an integer type. The result of such a
61 conversion when the source operand is a NaN isn't defined by
62 IEEE754, but by the Java language standard: it must be zero. Also,
63 overflows must be clipped to within range. This conversion
64 produces something like:
66 ((expr >= (float)MAX_INT)
68 : ((expr <= (float)MIN_INT)
75 convert_ieee_real_to_integer (type
, expr
)
79 expr
= save_expr (expr
);
81 result
= build (COND_EXPR
, type
,
82 build (NE_EXPR
, boolean_type_node
, expr
, expr
),
83 convert (type
, integer_zero_node
),
84 convert_to_integer (type
, expr
));
86 result
= build (COND_EXPR
, type
,
87 build (LE_EXPR
, boolean_type_node
, expr
,
88 convert (TREE_TYPE (expr
), TYPE_MIN_VALUE (type
))),
89 TYPE_MIN_VALUE (type
),
92 result
= build (COND_EXPR
, type
,
93 build (GE_EXPR
, boolean_type_node
, expr
,
94 convert (TREE_TYPE (expr
), TYPE_MAX_VALUE (type
))),
95 TYPE_MAX_VALUE (type
),
101 /* Create an expression whose value is that of EXPR,
102 converted to type TYPE. The TREE_TYPE of the value
103 is always TYPE. This function implements all reasonable
104 conversions; callers should filter out those that are
105 not permitted by the language being compiled. */
111 register enum tree_code code
= TREE_CODE (type
);
114 return build1 (NOP_EXPR
, type
, expr
);
116 if (type
== TREE_TYPE (expr
)
117 || TREE_CODE (expr
) == ERROR_MARK
)
119 if (TREE_CODE (TREE_TYPE (expr
)) == ERROR_MARK
)
120 return error_mark_node
;
121 if (code
== VOID_TYPE
)
122 return build1 (CONVERT_EXPR
, type
, expr
);
123 if (code
== BOOLEAN_TYPE
)
124 return fold (convert_to_boolean (type
, expr
));
125 if (code
== INTEGER_TYPE
)
128 && ! flag_emit_class_files
129 && TREE_CODE (TREE_TYPE (expr
)) == REAL_TYPE
130 && TARGET_FLOAT_FORMAT
== IEEE_FLOAT_FORMAT
)
131 return fold (convert_ieee_real_to_integer (type
, expr
));
133 return fold (convert_to_integer (type
, expr
));
135 if (code
== REAL_TYPE
)
136 return fold (convert_to_real (type
, expr
));
137 if (code
== CHAR_TYPE
)
138 return fold (convert_to_char (type
, expr
));
139 if (code
== POINTER_TYPE
)
140 return fold (convert_to_pointer (type
, expr
));
141 error ("conversion to non-scalar type requested");
142 return error_mark_node
;
147 convert_to_char (type
, expr
)
150 return build1 (NOP_EXPR
, type
, expr
);
154 convert_to_boolean (type
, expr
)
157 return build1 (NOP_EXPR
, type
, expr
);
160 /* Print an error message for invalid use of an incomplete type.
161 VALUE is the expression that was used (or 0 if that isn't known)
162 and TYPE is the type that was invalid. */
165 incomplete_type_error (value
, type
)
166 tree value ATTRIBUTE_UNUSED
;
167 tree type ATTRIBUTE_UNUSED
;
169 error ("internal error - use of undefined type");
172 /* Return a data type that has machine mode MODE.
173 If the mode is an integer,
174 then UNSIGNEDP selects between signed and unsigned types. */
177 type_for_mode (mode
, unsignedp
)
178 enum machine_mode mode
;
181 if (mode
== TYPE_MODE (int_type_node
))
182 return unsignedp
? unsigned_int_type_node
: int_type_node
;
183 if (mode
== TYPE_MODE (long_type_node
))
184 return unsignedp
? unsigned_long_type_node
: long_type_node
;
185 if (mode
== TYPE_MODE (short_type_node
))
186 return unsignedp
? unsigned_short_type_node
: short_type_node
;
187 if (mode
== TYPE_MODE (byte_type_node
))
188 return unsignedp
? unsigned_byte_type_node
: byte_type_node
;
189 if (mode
== TYPE_MODE (float_type_node
))
190 return float_type_node
;
191 if (mode
== TYPE_MODE (double_type_node
))
192 return double_type_node
;
197 /* Return an integer type with BITS bits of precision,
198 that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
201 type_for_size (bits
, unsignedp
)
205 if (bits
<= TYPE_PRECISION (byte_type_node
))
206 return unsignedp
? unsigned_byte_type_node
: byte_type_node
;
207 if (bits
<= TYPE_PRECISION (short_type_node
))
208 return unsignedp
? unsigned_short_type_node
: short_type_node
;
209 if (bits
<= TYPE_PRECISION (int_type_node
))
210 return unsignedp
? unsigned_int_type_node
: int_type_node
;
211 if (bits
<= TYPE_PRECISION (long_type_node
))
212 return unsignedp
? unsigned_long_type_node
: long_type_node
;
216 /* Return a type the same as TYPE except unsigned or
217 signed according to UNSIGNEDP. */
220 signed_or_unsigned_type (unsignedp
, type
)
224 if (! INTEGRAL_TYPE_P (type
))
226 if (TYPE_PRECISION (type
) == TYPE_PRECISION (int_type_node
))
227 return unsignedp
? unsigned_int_type_node
: int_type_node
;
228 if (TYPE_PRECISION (type
) == TYPE_PRECISION (byte_type_node
))
229 return unsignedp
? unsigned_byte_type_node
: byte_type_node
;
230 if (TYPE_PRECISION (type
) == TYPE_PRECISION (short_type_node
))
231 return unsignedp
? unsigned_short_type_node
: short_type_node
;
232 if (TYPE_PRECISION (type
) == TYPE_PRECISION (long_type_node
))
233 return unsignedp
? unsigned_long_type_node
: long_type_node
;
237 /* Return a signed type the same as TYPE in other respects. */
243 return signed_or_unsigned_type (0, type
);
246 /* Return an unsigned type the same as TYPE in other respects. */
252 return signed_or_unsigned_type (1, type
);
256 /* Mark EXP saying that we need to be able to take the
257 address of it; it should not be allocated in a register.
258 Value is 1 if successful. */
261 mark_addressable (exp
)
264 register tree x
= exp
;
266 switch (TREE_CODE (x
))
273 x
= TREE_OPERAND (x
, 0);
276 case TRUTH_ANDIF_EXPR
:
277 case TRUTH_ORIF_EXPR
:
279 x
= TREE_OPERAND (x
, 1);
283 return mark_addressable (TREE_OPERAND (x
, 1))
284 & mark_addressable (TREE_OPERAND (x
, 2));
287 TREE_ADDRESSABLE (x
) = 1;
291 /* We sometimes add a cast *(TYPE*)&FOO to handle type and mode
292 incompatibility problems. Handle this case by marking FOO. */
293 if (TREE_CODE (TREE_OPERAND (x
, 0)) == NOP_EXPR
294 && TREE_CODE (TREE_OPERAND (TREE_OPERAND (x
, 0), 0)) == ADDR_EXPR
)
296 x
= TREE_OPERAND (TREE_OPERAND (x
, 0), 0);
299 if (TREE_CODE (TREE_OPERAND (x
, 0)) == ADDR_EXPR
)
301 x
= TREE_OPERAND (x
, 0);
311 TREE_ADDRESSABLE (x
) = 1;
312 #if 0 /* poplevel deals with this now. */
313 if (DECL_CONTEXT (x
) == 0)
314 TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x
)) = 1;
322 /* Thorough checking of the arrayness of TYPE. */
325 is_array_type_p (type
)
328 return TREE_CODE (type
) == POINTER_TYPE
329 && TREE_CODE (TREE_TYPE (type
)) == RECORD_TYPE
330 && TYPE_ARRAY_P (TREE_TYPE (type
));
333 /* Return the length of a Java array type.
334 Return -1 if the length is unknown or non-constant. */
337 java_array_type_length (array_type
)
341 if (TREE_CODE (array_type
) == POINTER_TYPE
)
342 array_type
= TREE_TYPE (array_type
);
343 arfld
= TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (array_type
)));
344 if (arfld
!= NULL_TREE
)
346 tree index_type
= TYPE_DOMAIN (TREE_TYPE (arfld
));
347 tree high
= TYPE_MAX_VALUE (index_type
);
348 if (TREE_CODE (high
) == INTEGER_CST
)
349 return TREE_INT_CST_LOW (high
) + 1;
355 build_prim_array_type (element_type
, length
)
357 HOST_WIDE_INT length
;
359 tree max_index
= build_int_2 (length
- 1, 0);
360 TREE_TYPE (max_index
) = sizetype
;
361 return build_array_type (element_type
, build_index_type (max_index
));
364 /* Return a Java array type with a given ELEMENT_TYPE and LENGTH.
365 These are hashed (shared) using IDENTIFIER_SIGNATURE_TYPE.
366 The LENGTH is -1 if the length is unknown. */
369 build_java_array_type (element_type
, length
)
371 HOST_WIDE_INT length
;
375 tree elsig
= build_java_signature (element_type
);
376 tree el_name
= element_type
;
377 sprintf (buf
, length
>= 0 ? "[%d" : "[", length
);
378 sig
= ident_subst (IDENTIFIER_POINTER (elsig
), IDENTIFIER_LENGTH (elsig
),
380 t
= IDENTIFIER_SIGNATURE_TYPE (sig
);
382 return TREE_TYPE (t
);
384 IDENTIFIER_SIGNATURE_TYPE (sig
) = build_pointer_type (t
);
385 TYPE_ARRAY_P (t
) = 1;
387 if (TREE_CODE (el_name
) == POINTER_TYPE
)
388 el_name
= TREE_TYPE (el_name
);
389 el_name
= TYPE_NAME (el_name
);
390 if (TREE_CODE (el_name
) == TYPE_DECL
)
391 el_name
= DECL_NAME (el_name
);
392 TYPE_NAME (t
) = identifier_subst (el_name
, "", '.', '.', "[]");
394 set_java_signature (t
, sig
);
395 set_super_info (0, t
, object_type_node
, 0);
396 if (TREE_CODE (element_type
) == RECORD_TYPE
)
397 element_type
= promote_type (element_type
);
398 TYPE_ARRAY_ELEMENT (t
) = element_type
;
400 /* Add length pseudo-field. */
401 push_obstacks (&permanent_obstack
, &permanent_obstack
);
402 fld
= build_decl (FIELD_DECL
, get_identifier ("length"), int_type_node
);
403 TYPE_FIELDS (t
) = fld
;
404 DECL_CONTEXT (fld
) = t
;
405 FIELD_PUBLIC (fld
) = 1;
406 FIELD_FINAL (fld
) = 1;
410 tree atype
= build_prim_array_type (element_type
, length
);
411 tree arfld
= build_decl (FIELD_DECL
, get_identifier ("data"), atype
);
412 DECL_CONTEXT (arfld
) = t
;
413 TREE_CHAIN (fld
) = arfld
;
416 TYPE_ALIGN (t
) = TYPE_ALIGN (element_type
);
419 /* We could layout_class, but that loads java.lang.Object prematurely.
420 * This is called by the parser, and it is a bad idea to do load_class
421 * in the middle of parsing, because of possible circularity problems. */
422 push_super_field (t
, object_type_node
);
428 /* Promote TYPE to the type actually used for fields and parameters. */
434 switch (TREE_CODE (type
))
437 return build_pointer_type (CLASS_TO_HANDLE_TYPE (type
));
439 if (type
== boolean_type_node
)
440 return promoted_boolean_type_node
;
443 if (type
== char_type_node
)
444 return promoted_char_type_node
;
448 if (TYPE_PRECISION (type
) < TYPE_PRECISION (int_type_node
))
450 if (type
== short_type_node
)
451 return promoted_short_type_node
;
452 if (type
== byte_type_node
)
453 return promoted_byte_type_node
;
454 return int_type_node
;
456 /* ... else fall through ... */
462 /* Parse a signature string, starting at *PTR and ending at LIMIT.
463 Return the seen TREE_TYPE, updating *PTR. */
466 parse_signature_type (ptr
, limit
)
467 const unsigned char **ptr
, *limit
;
471 fatal ("bad signature string");
474 case 'B': (*ptr
)++; return byte_type_node
;
475 case 'C': (*ptr
)++; return char_type_node
;
476 case 'D': (*ptr
)++; return double_type_node
;
477 case 'F': (*ptr
)++; return float_type_node
;
478 case 'S': (*ptr
)++; return short_type_node
;
479 case 'I': (*ptr
)++; return int_type_node
;
480 case 'J': (*ptr
)++; return long_type_node
;
481 case 'Z': (*ptr
)++; return boolean_type_node
;
482 case 'V': (*ptr
)++; return void_type_node
;
484 for ((*ptr
)++; (*ptr
) < limit
&& ISDIGIT (**ptr
); ) (*ptr
)++;
485 type
= parse_signature_type (ptr
, limit
);
486 type
= build_java_array_type (type
, -1);
490 const unsigned char *start
= ++(*ptr
);
491 register const unsigned char *str
= start
;
495 fatal ("bad signature string");
500 type
= lookup_class (unmangle_classname (start
, str
- start
));
504 fatal ("unrecognized signature string");
506 return promote_type (type
);
509 /* Parse a Java "mangled" signature string, starting at SIG_STRING,
510 and SIG_LENGTH bytes long.
511 Return a gcc type node. */
514 parse_signature_string (sig_string
, sig_length
)
515 const unsigned char *sig_string
;
519 const unsigned char *str
= sig_string
;
520 const unsigned char *limit
= str
+ sig_length
;
522 push_obstacks (&permanent_obstack
, &permanent_obstack
);
523 if (str
< limit
&& str
[0] == '(')
525 tree argtype_list
= NULL_TREE
;
527 while (str
< limit
&& str
[0] != ')')
529 tree argtype
= parse_signature_type (&str
, limit
);
530 argtype_list
= tree_cons (NULL_TREE
, argtype
, argtype_list
);
532 if (str
++, str
>= limit
)
533 fatal ("bad signature string");
534 result_type
= parse_signature_type (&str
, limit
);
535 argtype_list
= chainon (nreverse (argtype_list
), end_params_node
);
536 result_type
= build_function_type (result_type
, argtype_list
);
539 result_type
= parse_signature_type (&str
, limit
);
541 error ("junk at end of signature string");
546 /* Convert a signature to its type.
547 * Uses IDENTIFIER_SIGNATURE_TYPE as a cache (except for primitive types).
551 get_type_from_signature (tree signature
)
553 const unsigned char *sig
= (const unsigned char *) IDENTIFIER_POINTER (signature
);
554 int len
= IDENTIFIER_LENGTH (signature
);
556 /* Primitive types aren't cached. */
558 return parse_signature_string (sig
, len
);
559 type
= IDENTIFIER_SIGNATURE_TYPE (signature
);
560 if (type
== NULL_TREE
)
562 type
= parse_signature_string (sig
, len
);
563 IDENTIFIER_SIGNATURE_TYPE (signature
) = type
;
568 /* Return the signature string for the arguments of method type TYPE. */
571 build_java_argument_signature (type
)
574 extern struct obstack temporary_obstack
;
575 tree sig
= TYPE_ARGUMENT_SIGNATURE (type
);
576 if (sig
== NULL_TREE
)
578 tree args
= TYPE_ARG_TYPES (type
);
579 if (TREE_CODE (type
) == METHOD_TYPE
)
580 args
= TREE_CHAIN (args
); /* Skip "this" argument. */
581 for (; args
!= end_params_node
; args
= TREE_CHAIN (args
))
583 tree t
= build_java_signature (TREE_VALUE (args
));
584 obstack_grow (&temporary_obstack
,
585 IDENTIFIER_POINTER (t
), IDENTIFIER_LENGTH (t
));
587 obstack_1grow (&temporary_obstack
, '\0');
589 sig
= get_identifier (obstack_base (&temporary_obstack
));
590 TYPE_ARGUMENT_SIGNATURE (type
) = sig
;
591 obstack_free (&temporary_obstack
, obstack_base (&temporary_obstack
));
596 /* Return the signature of the given TYPE. */
599 build_java_signature (type
)
603 push_obstacks (&permanent_obstack
, &permanent_obstack
);
604 while (TREE_CODE (type
) == POINTER_TYPE
)
605 type
= TREE_TYPE (type
);
606 if (TYPE_LANG_SPECIFIC (type
) == NULL
)
608 TYPE_LANG_SPECIFIC (type
) = (struct lang_type
*)
609 perm_calloc (1, sizeof (struct lang_type
));
611 sig
= TYPE_LANG_SPECIFIC (type
)->signature
;
612 if (sig
== NULL_TREE
)
615 switch (TREE_CODE (type
))
617 case BOOLEAN_TYPE
: sg
[0] = 'Z'; goto native
;
618 case CHAR_TYPE
: sg
[0] = 'C'; goto native
;
619 case VOID_TYPE
: sg
[0] = 'V'; goto native
;
621 switch (TYPE_PRECISION (type
))
623 case 8: sg
[0] = 'B'; goto native
;
624 case 16: sg
[0] = 'S'; goto native
;
625 case 32: sg
[0] = 'I'; goto native
;
626 case 64: sg
[0] = 'J'; goto native
;
627 default: goto bad_type
;
630 switch (TYPE_PRECISION (type
))
632 case 32: sg
[0] = 'F'; goto native
;
633 case 64: sg
[0] = 'D'; goto native
;
634 default: goto bad_type
;
638 sig
= get_identifier (sg
);
641 if (TYPE_ARRAY_P (type
))
643 t
= build_java_signature (TYPE_ARRAY_ELEMENT (type
));
644 sig
= ident_subst (IDENTIFIER_POINTER (t
), IDENTIFIER_LENGTH (t
),
649 t
= DECL_NAME (TYPE_NAME (type
));
650 sig
= ident_subst (IDENTIFIER_POINTER (t
), IDENTIFIER_LENGTH (t
),
657 extern struct obstack temporary_obstack
;
658 sig
= build_java_argument_signature (type
);
659 obstack_1grow (&temporary_obstack
, '(');
660 obstack_grow (&temporary_obstack
,
661 IDENTIFIER_POINTER (sig
), IDENTIFIER_LENGTH (sig
));
662 obstack_1grow (&temporary_obstack
, ')');
664 t
= build_java_signature (TREE_TYPE (type
));
665 obstack_grow0 (&temporary_obstack
,
666 IDENTIFIER_POINTER (t
), IDENTIFIER_LENGTH (t
));
668 sig
= get_identifier (obstack_base (&temporary_obstack
));
669 obstack_free (&temporary_obstack
,
670 obstack_base (&temporary_obstack
));
675 fatal ("internal error - build_java_signature passed invalid type");
677 TYPE_LANG_SPECIFIC (type
)->signature
= sig
;
683 /* Save signature string SIG (an IDENTIFIER_NODE) in TYPE for future use. */
686 set_java_signature (type
, sig
)
691 while (TREE_CODE (type
) == POINTER_TYPE
)
692 type
= TREE_TYPE (type
);
693 if (TYPE_LANG_SPECIFIC (type
) == NULL
)
695 TYPE_LANG_SPECIFIC (type
) = (struct lang_type
*)
696 perm_calloc (1, sizeof (struct lang_type
));
699 old_sig
= TYPE_LANG_SPECIFIC (type
)->signature
;
700 if (old_sig
!= NULL_TREE
&& old_sig
!= sig
)
701 fatal ("internal error - set_java_signature");
702 TYPE_LANG_SPECIFIC (type
)->signature
= sig
;
703 #if 0 /* careful about METHOD_TYPE */
704 if (IDENTIFIER_SIGNATURE_TYPE (sig
) == NULL_TREE
&& TREE_PERMANENT (type
))
705 IDENTIFIER_SIGNATURE_TYPE (sig
) = type
;
709 /* Search in class CLAS (and its superclasses) for a method
710 matching METHOD_NAME and argument signature METHOD_SIGNATURE.
711 Return a FUNCTION_DECL on success, or NULL_TREE if none found.
712 (Contrast lookup_java_method, which takes into account return type.) */
715 lookup_argument_method (clas
, method_name
, method_signature
)
716 tree clas
, method_name
, method_signature
;
719 while (clas
!= NULL_TREE
)
721 for (method
= TYPE_METHODS (clas
);
722 method
!= NULL_TREE
; method
= TREE_CHAIN (method
))
724 tree method_sig
= build_java_argument_signature (TREE_TYPE (method
));
725 tree name
= DECL_NAME (method
);
726 if ((TREE_CODE (name
) == EXPR_WITH_FILE_LOCATION
?
727 EXPR_WFL_NODE (name
) : name
) == method_name
728 && method_sig
== method_signature
)
731 clas
= CLASSTYPE_SUPER (clas
);
736 /* Search in class CLAS (and its superclasses) for a method
737 matching METHOD_NAME and signature METHOD_SIGNATURE.
738 Return a FUNCTION_DECL on success, or NULL_TREE if none found.
739 (Contrast lookup_argument_method, which ignores return type.) */
742 lookup_java_method (clas
, method_name
, method_signature
)
743 tree clas
, method_name
, method_signature
;
746 while (clas
!= NULL_TREE
)
748 for (method
= TYPE_METHODS (clas
);
749 method
!= NULL_TREE
; method
= TREE_CHAIN (method
))
751 tree method_sig
= build_java_signature (TREE_TYPE (method
));
752 if (DECL_NAME (method
) == method_name
753 && method_sig
== method_signature
)
756 clas
= CLASSTYPE_SUPER (clas
);
761 /* Search in class CLAS for a constructor matching METHOD_SIGNATURE.
762 Return a FUNCTION_DECL on success, or NULL_TREE if none found. */
765 lookup_java_constructor (clas
, method_signature
)
766 tree clas
, method_signature
;
768 tree method
= TYPE_METHODS (clas
);
769 for ( ; method
!= NULL_TREE
; method
= TREE_CHAIN (method
))
771 tree method_sig
= build_java_signature (TREE_TYPE (method
));
772 if (DECL_CONSTRUCTOR_P (method
) && method_sig
== method_signature
)
778 /* Return a type which is the Binary Numeric Promotion of the pair T1,
779 T2 and convert EXP1 and/or EXP2. See 5.6.2 Binary Numeric
780 Promotion. It assumes that both T1 and T2 are elligible to BNP. */
783 binary_numeric_promotion (t1
, t2
, exp1
, exp2
)
789 if (t1
== double_type_node
|| t2
== double_type_node
)
791 if (t1
!= double_type_node
)
792 *exp1
= convert (double_type_node
, *exp1
);
793 if (t2
!= double_type_node
)
794 *exp2
= convert (double_type_node
, *exp2
);
795 return double_type_node
;
797 if (t1
== float_type_node
|| t2
== float_type_node
)
799 if (t1
!= float_type_node
)
800 *exp1
= convert (float_type_node
, *exp1
);
801 if (t2
!= float_type_node
)
802 *exp2
= convert (float_type_node
, *exp2
);
803 return float_type_node
;
805 if (t1
== long_type_node
|| t2
== long_type_node
)
807 if (t1
!= long_type_node
)
808 *exp1
= convert (long_type_node
, *exp1
);
809 if (t2
!= long_type_node
)
810 *exp2
= convert (long_type_node
, *exp2
);
811 return long_type_node
;
814 if (t1
!= int_type_node
)
815 *exp1
= convert (int_type_node
, *exp1
);
816 if (t2
!= int_type_node
)
817 *exp2
= convert (int_type_node
, *exp2
);
818 return int_type_node
;