This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix type homogeneity bug
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Eric Botcazou" <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 30 Mar 2008 17:31:19 +0200
- Subject: Re: [PATCH] Fix type homogeneity bug
- References: <200803301719.23535.ebotcazou@adacore.com>
On Sun, Mar 30, 2008 at 5:19 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> The attached Ada testcase triggers a type checking failure:
>
> p.adb: In function 'P':
> p.adb:1: error: type mismatch in binary expression
> system__unsigned_types__long_long_unsigned
>
> p__Tb1S___XP1
>
> p__Tb2S___XP1
>
> D.202 = D.200 & D.201
>
> introduced by the constant folder. It is passed:
>
> (gdb) frame 4
> #4 0x0890c2f5 in fold_build2_stat (code=BIT_IOR_EXPR, type=0x55704a90,
> op0=0x557054a0, op1=0x557054c0)
> at /home/eric/gnat/gnat-head/src/gcc/fold-const.c:13370
> 13370 tem = fold_binary (code, type, op0, op1);
>
> (gdb) p debug_tree(type)
> <integer_type 0x55704a90 system__unsigned_types__long_long_unsigned
> sizes-gimplified public visited unsigned DI
>
> (gdb) p debug_tree(op0)
> <nop_expr 0x557054a0
> type <integer_type 0x55704a90 system__unsigned_types__long_long_unsigned
> sizes-gimplified public visited unsigned DI
> size <integer_cst 0x556dd71c constant invariant visited 64>
> unit size <integer_cst 0x556dd738 constant invariant visited 8>
> align 64 symtab 0 alias set -1 canonical type 0x55704a90 precision 64
> min <integer_cst 0x556ff594 0> max <integer_cst 0x556ff578 -1> RM size
> <integer_cst 0x556dd71c 64>>
>
> arg 0 <bit_not_expr 0x55705420
> type <integer_type 0x55704a28 p__Tb1S___XP1 type <integer_type
> 0x55704a90 system__unsigned_types__long_long_unsigned>
>
> (gdb) p debug_tree(op1)
> <nop_expr 0x557054c0
> type <integer_type 0x55704a90 system__unsigned_types__long_long_unsigned
> sizes-gimplified public visited unsigned DI
> size <integer_cst 0x556dd71c constant invariant visited 64>
> unit size <integer_cst 0x556dd738 constant invariant visited 8>
> align 64 symtab 0 alias set -1 canonical type 0x55704a90 precision 64
> min <integer_cst 0x556ff594 0> max <integer_cst 0x556ff578 -1> RM size
> <integer_cst 0x556dd71c 64>>
>
> arg 0 <bit_not_expr 0x55705480
> type <integer_type 0x55704f70 p__Tb2S___XP1 type <integer_type
> 0x55704a90 system__unsigned_types__long_long_unsigned>
>
> and yields:
>
> <bit_and_expr 0x556e1558
> type <integer_type 0x55704a90 system__unsigned_types__long_long_unsigned
> sizes-gimplified public visited unsigned DI
> size <integer_cst 0x556dd71c constant invariant visited 64>
> unit size <integer_cst 0x556dd738 constant invariant visited 8>
> align 64 symtab 0 alias set -1 canonical type 0x55704a90 precision 64
> min <integer_cst 0x556ff594 0> max <integer_cst 0x556ff578 -1> RM size
> <integer_cst 0x556dd71c 64>>
>
> arg 0 <component_ref 0x556e8118
> type <integer_type 0x55704a28 p__Tb1S___XP1 type <integer_type
> 0x55704a90 system__unsigned_types__long_long_unsigned>
>
> arg 1 <component_ref 0x556e8140
> type <integer_type 0x55704f70 p__Tb2S___XP1 type <integer_type
> 0x55704a90 system__unsigned_types__long_long_unsigned>
>
>
> Tested on x86_64-suse-linux, OK for mainline?
Yes, thanks.
Richard.
>
> 2008-03-30 Eric Botcazou <ebotcazou@adacore.com>
>
> * fold-const.c (fold_binary) <BIT_IOR_EXPR>: Add missing conversions.
>
>
> 2008-03-30 Eric Botcazou <ebotcazou@adacore.com>
>
> * gnat.dg/bit_packed_array2.adb: New test.
>
>
> --
> Eric Botcazou
>