This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Get rid of awkward semantics for subtypes


On Sun, May 10, 2009 at 6:58 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> as explained in http://gcc.gnu.org/ml/gcc/2009-04/msg00323.html the attached
> patch gets rid of the awkward semantics implemented for subtypes (INTEGER_TYPE
> with a non-NULL TREE_TYPE). ?It doesn't get rid of subtypes because they are
> needed for certain things but promotes them to first-class citizenship, so
> that it shouldn't be necessary to specifically check for them anymore in the
> middle-end, except for debugging information. ?It's up to the front-end to
> make sure that range subtypes, e.g. built for arrays in all languages, don't
> leak into the code.
>
> Tested on i586-suse-linux with the associated Gigi patch, OK for mainline?

@@ -3742,6 +3742,7 @@ fold_truth_not_expr (tree arg)
       return invert_truthvalue (TREE_OPERAND (arg, 0));

     case NOP_EXPR:
+    case CONVERT_EXPR:
       if (TREE_CODE (TREE_TYPE (arg)) == BOOLEAN_TYPE)
        {
          t = build1 (TRUTH_NOT_EXPR, type, arg);

CASE_CONVERT:


The patch is ok with this change.  Please leave others 24h to comment.

Thanks,
Richard.

>
> 2009-05-10 ?Eric Botcazou ?<ebotcazou@adacore.com>
>
> ? ? ? ?* dbxout.c (dbxout_type): Be prepared to deal with subtypes.
> ? ? ? ?* dwarf2out.c (base_type_die): Likewise.
> ? ? ? ?(is_subrange_type): Delete.
> ? ? ? ?(subrange_type_die): Add LOW and HIGH parameters. ?Use them for bounds.
> ? ? ? ?(modified_type_die): Call subrange_type_for_debug_p on subtypes.
> ? ? ? ?* fold-const.c (fold_truth_not_expr) <CONVERT_EXPR>: Do not strip
> ? ? ? ?it if the destination type is boolean.
> ? ? ? ?(build_range_check): Do not special-case subtypes.
> ? ? ? ?(fold_sign_changed_comparison): Likewise.
> ? ? ? ?(fold_unary): Likewise.
> ? ? ? ?* langhooks-def.h (LANG_HOOKS_GET_SUBRANGE_BOUNDS): Define.
> ? ? ? ?(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add LANG_HOOKS_GET_SUBRANGE_BOUNDS.
> ? ? ? ?* langhooks.h (lang_hooks_for_types): Add get_subrange_bounds.
> ? ? ? ?* tree.h (subrange_type_for_debug_p): Declare.
> ? ? ? ?* tree.c (subrange_type_for_debug_p): New predicate based on the
> ? ? ? ?former is_subrange_type.
> ? ? ? ?* tree-chrec.c (avoid_arithmetics_in_type_p): Delete.
> ? ? ? ?(convert_affine_scev): Remove call to above function.
> ? ? ? ?(chrec_convert_aggressive): Likewise.
> ? ? ? ?* tree-ssa.c (useless_type_conversion_p_1): Do not specifically return
> ? ? ? ?false for conversions involving subtypes.
> ? ? ? ?* tree-vrp.c (vrp_val_max): Do not special-case subtypes.
> ? ? ? ?(vrp_val_min): Likewise.
> ? ? ? ?(needs_overflow_infinity): Likewise.
> ? ? ? ?(extract_range_from_unary_expr): Likewise.
>
>
> --
> Eric Botcazou
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]