This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR59990
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, ebotcazou at adacore dot com
- Date: Thu, 30 Jan 2014 19:34:36 +0100
- Subject: Re: [PATCH] Fix PR59990
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1401301922380 dot 29326 at zhemvz dot fhfr dot qr>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Jan 30, 2014 at 07:25:03PM +0100, Richard Biener wrote:
> *** 8886,8891 ****
> --- 8892,8932 ----
> || TREE_ADDRESSABLE (desttype))
> return NULL_TREE;
>
> + /* Make sure we are not copying using a floating-point mode or
> + a type whose size possibly does not match its precision. */
> + if (FLOAT_MODE_P (TYPE_MODE (desttype))
> + || TREE_CODE (desttype) == BOOLEAN_TYPE
> + || TREE_CODE (desttype) == ENUMERAL_TYPE)
> + {
> + /* A more suitable int_mode_for_mode would return a vector
> + integer mode for a vector float mode or a integer complex
> + mode for a float complex mode if there isn't a regular
> + integer mode covering the mode of desttype. */
> + enum machine_mode mode = int_mode_for_mode (TYPE_MODE (desttype));
> + if (mode == BLKmode)
> + desttype = NULL_TREE;
> + else
> + desttype = build_nonstandard_integer_type (GET_MODE_BITSIZE (mode),
> + 1);
> + }
As I said in the PR, I think you want to do the build_aligned_type
just in case e.g. the floating point type is more aligned than the integer
or vice versa.
> - {
> - tree srcitype
> - = lang_hooks.types.type_for_mode (TYPE_MODE (srctype),
> - TYPE_UNSIGNED (srctype));
> - srctype = build_aligned_type (srcitype, TYPE_ALIGN (srctype));
> - }
> -
Jakub