[Bug middle-end/68565] [6 Regression] graphite : -O2 -floop-nest-optimize miscompile

spop at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 30 20:39:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68565

--- Comment #2 from Sebastian Pop <spop at gcc dot gnu.org> ---
Author: spop
Date: Mon Nov 30 20:39:16 2015
New Revision: 231086

URL: https://gcc.gnu.org/viewcvs?rev=231086&root=gcc&view=rev
Log:
check for ISL generated code that leads to division by zero

we used to generate modulo and division by zero because ISL uses big numbers
which translate to zero in modulo arithmetic.  The patch also improves error
handling
and bails out early in case of wrong code gen.

        PR tree-optimization/68565
        * graphite-isl-ast-to-gimple.c (binary_op_to_tree): Early return on
        codegen_error.  Fail when rhs of division operations is integer_zerop.
        (ternary_op_to_tree): Early return on codegen_error.
        (unary_op_to_tree): Same.
        (nary_op_to_tree): Same.
        (gcc_expression_from_isl_expr_op): Same.
        (gcc_expression_from_isl_expression): Same.
        (graphite_create_new_loop): On codegen_error continue generating
        wrong code.
        (graphite_create_new_loop_guard): Same.
        (build_iv_mapping): Same.
        (graphite_create_new_guard): Same.

        * gfortran.dg/graphite/pr68565.f90: New.

Added:
    trunk/gcc/testsuite/gfortran.dg/graphite/pr68565.f90
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/graphite-isl-ast-to-gimple.c
    trunk/gcc/testsuite/ChangeLog


More information about the Gcc-bugs mailing list