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: Do not use TYPE_CANONICAL in useless_type_conversion


Hi,

On Fri, 2 Oct 2015 23:31:09, Eric Botcazou wrote:
>
> It's related to a known difficulty with alignment and inheritance, and other
> languages are affected by variant of it, see e.g. PR c++/37798.
>

I doubt that this is still an issue with the current trunk.

I tried the test case from the pr37798 on x86_64, and now the object is 8-aligned,
but the object was only 4-byte aligned according to the comments in the bugzilla
at that time.

If the middle-end would not know the alignment by means of get_object_alignment
that would break the tsan instrumentation immediately, because the tsan library only
works for correctly aligned data accesses.

BTW: It is easy to list all gcc-6 regressions, but is there also a way to query the bugzilla
for old and believed-to-be unfixable bugs?

I mean something like that one is technically not a regression, but it would be good to
locate forgotten trackers, and revive them from time to time...


>> You remember, when I removed the TYPE_ALIGN_OK handing (initially it wasn't
>> clear to me that it's entire use is only to make Ada happy), all Ada tests
>> continued to pass, even on ARM. BTW: You promised me last year to give me
>> an example where that makes a difference.
>
> I know, but that's low priority, sorry. You can probably browse the 2004
> archives and find one (or a sketch of one); that being said, gigi was a bit
> changed since then so this could as well be obsolete.
>



I digged a bit, but did not find any hint for Ada test cases though.

This change introduced TYPE_ALIGN_OK to get_inner_reference for the first time.
I did not find the discussion for that in the archives:

------------------------------------------------------------------------
r66465 | kenner | 2003-05-05 00:09:48 +0200 (Mo, 05. Mai 2003) | 6 Zeilen

    * expr.c (store_field): Don't clobber TEMP in shift: it might be
    a variable.
    (get_inner_reference): Don't go through a VIEW_CONVERT_EXPR
    whose purpose is to step up the alignment.
    (expand_expr, case ADDR_EXPR): Force LO_SUM into memory, just like REG.


And this change rewrote the code to the form that caused a regression,
that was fixed later by you:

------------------------------------------------------------------------
r91511 | rth | 2004-11-30 04:52:37 +0100 (Di, 30. Nov 2004) | 14 Zeilen

        * expr.c (get_inner_reference): Handle REAL/IMAGPART_EXPR.
        (handled_component_p): Likewise.
        * alias.c (can_address_p): Reformat and simplify.  Handle
        REAL/IMAGPART_EXPR.  Do not disable addressability based on
        alias set zero.
        * fold-const.c (build_fold_addr_expr_with_type): Remove duplicate
        check for REAL/IMAGPART_EXPR.
        * gimplify.c (gimplify_compound_lval): Likewise.
        * tree-cfg.c (verify_expr): Likewise.
        * tree-gimple.c (is_gimple_addressable, get_base_address): Likewise.
        * tree-nested.c (build_addr, convert_nonlocal_reference): Likewise.
        (convert_local_reference): Likewise.
        * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Likewise.


That one was discussed here: https://gcc.gnu.org/ml/gcc-patches/2004-11/msg02652.html
aka pr15289, the corresponding test case was added to the test suite later.
But there was no Ada problem reported at that time.


Bernd.
 		 	   		  

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