This is the mail archive of the gcc-bugs@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]

[Bug middle-end/71078] x/abs(x) -> sign(1.0,x)


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

Thomas Preud'homme <thopre01 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |thopre01 at gcc dot gnu.org
         Resolution|FIXED                       |---

--- Comment #10 from Thomas Preud'homme <thopre01 at gcc dot gnu.org> ---
Hi,

The following tests are still failing for me on arm-none-eabi targets:

FAIL: gcc.dg/tree-ssa/pr71078-1.c scan-tree-dump forwprop1
"__builtin_copysignf"
FAIL: gcc.dg/tree-ssa/pr71078-1-double.c scan-tree-dump forwprop1
"__builtin_copysign"
FAIL: gcc.dg/tree-ssa/pr71078-2.c scan-tree-dump forwprop1
"__builtin_copysignf"
FAIL: gcc.dg/tree-ssa/pr71078-2-double.c scan-tree-dump forwprop1
"__builtin_copysign"
FAIL: gcc.dg/tree-ssa/pr71078-3.c scan-tree-dump forwprop1 "__builtin_copysign"


My investigation for pr71078-1.c led me to the first if block in
gimple_fold_stmt_to_constant_1. if gimple_simplify returns true as it does when
matching the x / abs(x) -> copysign (1.0, x) match.pd pattern. However
gimple_simplified_result_is_gimple_val is false because copysign is a builtin
and mprts_hook is NULL at this point.

The switch that follows goes in GIMPLE_BINARY_RHS case to return NULL_TREE
because it does not recognize an operation it knows about.

I suspect the same happens for the other testcases.

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