This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Do not use TYPE_CANONICAL in useless_type_conversion
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Eric Botcazou <ebotcazou at adacore dot com>, gcc-patches at gcc dot gnu dot org, Richard Biener <rguenther at suse dot de>, Bernd Schmidt <bschmidt at redhat dot com>, law at redhat dot com
- Date: Fri, 16 Oct 2015 08:43:09 +0200
- Subject: Re: Do not use TYPE_CANONICAL in useless_type_conversion
- Authentication-results: sourceware.org; auth=none
- References: <20151002180022 dot GA32564 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1510071050390 dot 6516 at zhemvz dot fhfr dot qr> <20151008034934 dot GB47818 at kam dot mff dot cuni dot cz> <3499233 dot dG6t8mJFET at polaris> <mvm37xl1gtw dot fsf at hawking dot suse dot de> <20151008230518 dot GE90964 at kam dot mff dot cuni dot cz> <877fmwbdth dot fsf at igel dot home>
> Jan Hubicka <hubicka@ucw.cz> writes:
>
> > Does the patch in https://gcc.gnu.org/ml/gcc-patches/2015-10/msg00902.html help?
>
> No, it doesn't.
>
Andreas,
I am sorry for getting late to this. I hoped that the alternative patch by Alexandre would fix this.
I still don't know how to reproduce without IA-64 box, so I am attaching a patch that I think should
fix it. Does the attached patch work?
Thank you,
Jan
Index: expr.c
===================================================================
--- expr.c (revision 228851)
+++ expr.c (working copy)
@@ -6669,9 +6669,16 @@ store_field (rtx target, HOST_WIDE_INT b
GET_MODE_BITSIZE (GET_MODE (temp)) - bitsize,
NULL_RTX, 1);
+ /* We allow move between structures of same size but different mode.
+ If source is in memory and the mode differs, simply change the memory. */
+ if (GET_MODE (temp) == BLKmode && mode != BLKmode)
+ {
+ gcc_assert (MEM_P (temp));
+ temp = adjust_address_nv (temp, mode, 0);
+ }
/* Unless MODE is VOIDmode or BLKmode, convert TEMP to MODE. */
- if (mode != VOIDmode && mode != BLKmode
- && mode != TYPE_MODE (TREE_TYPE (exp)))
+ else if (mode != VOIDmode && mode != BLKmode
+ && mode != TYPE_MODE (TREE_TYPE (exp)))
temp = convert_modes (mode, TYPE_MODE (TREE_TYPE (exp)), temp, 1);
/* If TEMP is not a PARALLEL (see below) and its mode and that of TARGET