This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR39922 and PR39927
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 28 Apr 2009 10:36:58 +0200
- Subject: Re: [patch] Fix PR39922 and PR39927
- References: <Pine.LNX.4.64.0904271759191.29566@wotan.suse.de>
On Mon, Apr 27, 2009 at 6:02 PM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> this fixes one miscompilation involving RTL constants (on i686-linux) and
> an ICE on cris (involving promoted arguments). ?It might help the sparc
> problem (also about promoted args).
>
> It might not help powerpc, as the former was already tested and the second
> patch helps ICEs, not miscompilations.
>
> regstrapped on x8_64-linux (and verified the reported errors are gone on
> cris and i686).
>
> Okay?
Ok.
Thanks,
Richard.
>
> Ciao,
> Michael.
> --
> ? ? ? ?PR middle-end/39922
> ? ? ? ?* tree-outof-ssa.c (insert_value_copy_on_edge): Don't convert constants.
> ? ? ? ?PR middle-end/39927
> ? ? ? ?* cfgexpand.c (expand_one_register_var): Correctly promote mode for PARM_DECLs.
>
> Index: tree-outof-ssa.c
> ===================================================================
> --- tree-outof-ssa.c ? ?(revision 146829)
> +++ tree-outof-ssa.c ? ?(working copy)
> @@ -184,7 +184,7 @@ insert_value_copy_on_edge (edge e, int d
> ? start_sequence ();
> ? mode = GET_MODE (SA.partition_to_pseudo[dest]);
> ? x = expand_expr (src, SA.partition_to_pseudo[dest], mode, EXPAND_NORMAL);
> - ?if (GET_MODE (x) != mode)
> + ?if (GET_MODE (x) != VOIDmode && GET_MODE (x) != mode)
> ? ? x = convert_to_mode (mode, x, TYPE_UNSIGNED (TREE_TYPE (src)));
> ? if (x != SA.partition_to_pseudo[dest])
> ? ? emit_move_insn (SA.partition_to_pseudo[dest], x);
> Index: cfgexpand.c
> ===================================================================
> --- cfgexpand.c (revision 146824)
> +++ cfgexpand.c (working copy)
> @@ -1049,7 +1049,9 @@ expand_one_register_var (tree var)
> ? tree type = TREE_TYPE (decl);
> ? int unsignedp = TYPE_UNSIGNED (type);
> ? enum machine_mode reg_mode
> - ? ?= promote_mode (type, DECL_MODE (decl), &unsignedp, 0);
> + ? ?= promote_mode (type, DECL_MODE (decl), &unsignedp,
> + ? ? ? ? ? ? ? ? ? (TREE_CODE (decl) == RESULT_DECL
> + ? ? ? ? ? ? ? ? ? ?|| TREE_CODE (decl) == PARM_DECL) ? 1 : 0);
> ? rtx x = gen_reg_rtx (reg_mode);
>
> ? set_rtl (var, x);
>