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: [RFTesting] New POINTER_DIFF_EXPR


Hi Marc,


On 20 November 2017 at 00:54, Marc Glisse <marc.glisse@inria.fr> wrote:
> Hello,
>
> new version, regtested on powerpc64le-unknown-linux-gnu. The front-end parts
> are up for review.
>
> 2017-10-28  Marc Glisse  <marc.glisse@inria.fr>
>
> gcc/c/
>         * c-fold.c (c_fully_fold_internal): Handle POINTER_DIFF_EXPR.
>         * c-typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
>
> gcc/c-family/
>         * c-pretty-print.c (pp_c_additive_expression,
>         c_pretty_printer::expression): Handle POINTER_DIFF_EXPR.
>
> gcc/cp/
>         * constexpr.c (cxx_eval_constant_expression,
>         potential_constant_expression_1): Handle POINTER_DIFF_EXPR.
>         * cp-gimplify.c (cp_fold): Likewise.
>         * error.c (dump_expr): Likewise.
>         * typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
>
> gcc/
>         * doc/generic.texi: Document POINTER_DIFF_EXPR, update
>         POINTER_PLUS_EXPR.
>         * cfgexpand.c (expand_debug_expr): Handle POINTER_DIFF_EXPR.
>         * expr.c (expand_expr_real_2): Likewise.
>         * fold-const.c (const_binop, fold_addr_of_array_ref_difference,
>         fold_binary_loc): Likewise.
>         * match.pd (X-X, P+(Q-P), &D-P, (P+N)-P, P-(P+N), (P+M)-(P+N),
>         P-Q==0, -(A-B), X-Z<Y-Z, (X-Z)-(Y-Z), Z-X<Z-Y, (Z-X)-(Z-Y),
>         (A-B)+(C-A)): New transformations for POINTER_DIFF_EXPR, based on
>         MINUS_EXPR transformations.
>         * optabs-tree.c (optab_for_tree_code): Handle POINTER_DIFF_EXPR.
>         * tree-cfg.c (verify_expr, verify_gimple_assign_binary): Likewise.
>         * tree-inline.c (estimate_operator_cost): Likewise.
>         * tree-pretty-print.c (dump_generic_node, op_code_prio,
>         op_symbol_code): Likewise.
>         * tree-vect-stmts.c (vectorizable_operation): Likewise.
>         * vr-values.c (extract_range_from_binary_expr): Likewise.
>         * varasm.c (initializer_constant_valid_p_1): Likewise.
>
>         * tree.def: New tree code POINTER_DIFF_EXPR.
>

Since you committed this patch (r255021), my cross-builds of GCC for
aarch64-linux-gnu fail while building glibc:
/tmp/6857183_6.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/bin/aarch64-none-linux-gnu-gcc
fetch-value.c -c -std=gnu99 -fgnu89-inline  -O2 -Wall -Winline -Wundef
-Wwrite-string
s -fmerge-all-constants -frounding-math -g -Wstrict-prototypes   -fPIC
       -I../include
-I/tmp/6857183_6.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-aarch64-none-linux-gnu/gl
ibc-1/nptl_db  -I/tmp/6857183_6.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-aarch64-none-linux-gnu/glibc-1
 -I../sysdeps/unix/sysv/linux/aarch64/nptl  -I../sysdeps/unix/sysv/lin
ux/aarch64  -I../sysdeps/unix/sysv/linux/generic
-I../sysdeps/unix/sysv/linux/wordsize-64
-I../nptl/sysdeps/unix/sysv/linux  -I../nptl/sysdeps/pthread
-I../sysdeps/pthread  -I
../sysdeps/unix/sysv/linux  -I../sysdeps/gnu  -I../sysdeps/unix/inet
-I../nptl/sysdeps/unix/sysv  -I../sysdeps/unix/sysv
-I../nptl/sysdeps/unix  -I../sysdeps/unix  -I../sysdeps
/posix  -I../sysdeps/aarch64/fpu  -I../sysdeps/aarch64/nptl
-I../sysdeps/aarch64  -I../sysdeps/wordsize-64
-I../sysdeps/ieee754/ldbl-128  -I../sysdeps/ieee754/dbl-64/wordsize-6
4  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32
-I../sysdeps/aarch64/soft-fp  -I../sysdeps/ieee754
-I../sysdeps/generic  -I../nptl  -I.. -I../libio -I. -nostdinc -i
system /tmp/6857183_6.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/lib/gcc/aarch64-none-linux-gnu/8.0.0/include
-isystem /tmp/6857183_6.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc
/tools/lib/gcc/aarch64-none-linux-gnu/8.0.0/include-fixed -isystem
/tmp/6857183_6.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/sysroot-aarch64-none-linux-gnu/usr/include
 -D_LIBC_REE
NTRANT -include ../include/libc-symbols.h  -DPIC -DSHARED
-DNOT_IN_libc=1 -DIS_IN_libthread_db=1 -DIN_LIB=libthread_db    -o
/tmp/6857183_6.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccs
rc/obj-aarch64-none-linux-gnu/glibc-1/nptl_db/fetch-value.os -MD -MP
-MF /tmp/6857183_6.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-aarch64-none-linux-gnu/glibc-1/nptl_db/fetch-
value.os.dt -MT
/tmp/6857183_6.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-aarch64-none-linux-gnu/glibc-1/nptl_db/fetch-value.os
during GIMPLE pass: vrp
fetch-value.c: In function '_td_locate_field':
fetch-value.c:44:1: internal compiler error: Segmentation fault
 _td_locate_field (td_thragent_t *ta,
 ^~~~~~~~~~~~~~~~
0xb87c75 crash_signal
        /tmp/6857183_6.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/toplev.c:325
0x5b1934 contains_struct_check
        /tmp/6857183_6.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/tree.h:3459
0x5b1934 wi::to_wide(tree_node const*)
        /tmp/6857183_6.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/tree.h:5247
0xf05557 vr_values::two_valued_val_range_p(tree_node*, tree_node**, tree_node**)
        /tmp/6857183_6.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/vr-values.c:4051
0xf0ee48 vr_values::simplify_stmt_using_ranges(gimple_stmt_iterator*)
        /tmp/6857183_6.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/vr-values.c:4115
0xd7068f substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
        /tmp/6857183_6.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/tree-ssa-propagate.c:1073
0x1204860 dom_walker::walk(basic_block_def*)
        /tmp/6857183_6.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/domwalk.c:308
0xd6e805 substitute_and_fold_engine::substitute_and_fold()
        /tmp/6857183_6.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/tree-ssa-propagate.c:1173
0xe71b0b vrp_prop::vrp_finalize(bool)
        /tmp/6857183_6.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/tree-vrp.c:6788
0xe81667 execute_vrp
        /tmp/6857183_6.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/tree-vrp.c:6864
Please submit a full bug report,

No such problem on arm targets.

Can you have a look?

Thanks,

Christophe

> --
> Marc Glisse


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