public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/94991] New: ICE: Segmentation fault with option -mgeneral-regs-only
@ 2020-05-08  2:08 felix.yang at huawei dot com
  2020-05-08  2:09 ` [Bug target/94991] " felix.yang at huawei dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: felix.yang at huawei dot com @ 2020-05-08  2:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94991
           Summary: ICE: Segmentation fault with option
                    -mgeneral-regs-only
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: felix.yang at huawei dot com
  Target Milestone: ---
            Target: aarch64

Yet another ICE with -mgeneral-regs-only:

foo.c
struct S { float d; };

void bar (struct S);

void
f0 (int x)
{
  struct S s = {.d = 0.0f };
  ((char *) &s.d)[0] = x;
  s.d *= 7.0;
  bar (s);
}

$aarch64-linux-gnu-gcc -S -O2 -mgeneral-regs-only foo.c

pr99999.c: In function ‘f0’:
pr99999.c:8:12: error: ‘-mgeneral-regs-only’ is incompatible with the use of
floating-point types
    8 |   struct S s = {.d = 0.0f };
      |            ^
pr99999.c:10:7: error: ‘-mgeneral-regs-only’ is incompatible with the use of
floating-point types
   10 |   s.d *= 7.0;
      |   ~~~~^~~~~~
pr99999.c:10:7: error: ‘-mgeneral-regs-only’ is incompatible with the use of
floating-point types
pr99999.c:10:7: error: ‘-mgeneral-regs-only’ is incompatible with the use of
floating-point types during RTL pass: expand
pr99999.c:10:7: internal compiler error: Segmentation fault 0x12a7a0b
crash_signal
        ../../gcc-git/gcc/toplev.c:328
0xb05a70 single_set(rtx_insn const*)
        ../../gcc-git/gcc/rtl.h:3437
0xd1dd2f emit_move_insn(rtx_def*, rtx_def*)
        ../../gcc-git/gcc/expr.c:3858
0xb5c837 emit_library_call_value_1(int, rtx_def*, rtx_def*, libcall_type,
machine_mode, int, std::pair<rtx_def*, machine_mode>*)
        ../../gcc-git/gcc/calls.c:5597
0xb42dab emit_library_call_value(rtx_def*, rtx_def*, libcall_type,
machine_mode, rtx_def*, machine_mode, rtx_def*, machine_mode)
        ../../gcc-git/gcc/rtl.h:4257
0x10f0ff3 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
        ../../gcc-git/gcc/optabs.c:1831
0xd05133 expand_mult(machine_mode, rtx_def*, rtx_def*, rtx_def*, int, bool)
        ../../gcc-git/gcc/expmed.c:3568
0xd3291f expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
        ../../gcc-git/gcc/expr.c:9046
0xd36c0f expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ../../gcc-git/gcc/expr.c:10054
0xd2f2e3 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
        ../../gcc-git/gcc/expr.c:8358
0xd10943 expand_normal
        ../../gcc-git/gcc/expr.h:288
0xd29ecb store_field
        ../../gcc-git/gcc/expr.c:7102
0xd2256b expand_assignment(tree_node*, tree_node*, bool)
        ../../gcc-git/gcc/expr.c:5374
0xb82f1b expand_gimple_stmt_1
        ../../gcc-git/gcc/cfgexpand.c:3749
0xb83387 expand_gimple_stmt
        ../../gcc-git/gcc/cfgexpand.c:3847
0xb8ba73 expand_gimple_basic_block
        ../../gcc-git/gcc/cfgexpand.c:5887
0xb8d8d3 execute
        ../../gcc-git/gcc/cfgexpand.c:6542

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/94991] ICE: Segmentation fault with option -mgeneral-regs-only
  2020-05-08  2:08 [Bug target/94991] New: ICE: Segmentation fault with option -mgeneral-regs-only felix.yang at huawei dot com
@ 2020-05-08  2:09 ` felix.yang at huawei dot com
  2020-05-11 14:19 ` [Bug target/94991] aarch64: " cvs-commit at gcc dot gnu.org
  2020-05-18  8:29 ` rsandifo at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: felix.yang at huawei dot com @ 2020-05-08  2:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Fei Yang <felix.yang at huawei dot com> ---
For the given testcase, we are doing FAIL for scalar floating move expand
pattern since TARGET_FLOAT is false with option -mgeneral-regs-only. But move
expand pattern cannot fail. It would be better to to replace the FAIL with code
that bitcasts to the equivalent integer mode, using gen_lowpart.  Will propose
a patch for this.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/94991] aarch64: ICE: Segmentation fault with option -mgeneral-regs-only
  2020-05-08  2:08 [Bug target/94991] New: ICE: Segmentation fault with option -mgeneral-regs-only felix.yang at huawei dot com
  2020-05-08  2:09 ` [Bug target/94991] " felix.yang at huawei dot com
@ 2020-05-11 14:19 ` cvs-commit at gcc dot gnu.org
  2020-05-18  8:29 ` rsandifo at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-11 14:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Sandiford <rsandifo@gcc.gnu.org>:

https://gcc.gnu.org/g:248e357f6941fe9409658386dc9b86b75dfd96c6

commit r11-269-g248e357f6941fe9409658386dc9b86b75dfd96c6
Author: Fei Yang <felix.yang@huawei.com>
Date:   Mon May 11 15:18:47 2020 +0100

    aarch64: Fix ICE when expanding scalar floating move with
-mgeneral-regs-only. [PR94991]

    In the testcase for PR94991, we are doing FAIL for scalar floating move
expand
    pattern since TARGET_FLOAT is false with option -mgeneral-regs-only. But
move
    expand pattern cannot fail. It would be better to replace the FAIL with
code
    that bitcasts to the equivalent integer mode using gen_lowpart.

    2020-05-11  Felix Yang  <felix.yang@huawei.com>

    gcc/
            PR target/94991
            * config/aarch64/aarch64.md (mov<mode>):
            Bitcasts to the equivalent integer mode using gen_lowpart
            instead of doing FAIL for scalar floating point move.

    gcc/testsuite/
            PR target/94991
            * gcc.target/aarch64/mgeneral-regs_5.c: New test.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/94991] aarch64: ICE: Segmentation fault with option -mgeneral-regs-only
  2020-05-08  2:08 [Bug target/94991] New: ICE: Segmentation fault with option -mgeneral-regs-only felix.yang at huawei dot com
  2020-05-08  2:09 ` [Bug target/94991] " felix.yang at huawei dot com
  2020-05-11 14:19 ` [Bug target/94991] aarch64: " cvs-commit at gcc dot gnu.org
@ 2020-05-18  8:29 ` rsandifo at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2020-05-18  8:29 UTC (permalink / raw)
  To: gcc-bugs

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

rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> changed:

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

--- Comment #3 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Fixed on trunk.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-18  8:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  2:08 [Bug target/94991] New: ICE: Segmentation fault with option -mgeneral-regs-only felix.yang at huawei dot com
2020-05-08  2:09 ` [Bug target/94991] " felix.yang at huawei dot com
2020-05-11 14:19 ` [Bug target/94991] aarch64: " cvs-commit at gcc dot gnu.org
2020-05-18  8:29 ` rsandifo at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).