public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/100993] New: ICE with -O2: Segmentation fault, cgraph_update_edges_for_call_stmt(gimple*, tree_node*, gimple*)
@ 2021-06-09 14:25 cnsun at uwaterloo dot ca
  2021-06-10  6:42 ` [Bug c/100993] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: cnsun at uwaterloo dot ca @ 2021-06-09 14:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100993
           Summary: ICE with -O2: Segmentation fault,
                    cgraph_update_edges_for_call_stmt(gimple*, tree_node*,
                    gimple*)
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210609 (experimental) [master revision
:c23bc3c72:87f9ac937d6cfd81cbbe0a43518ba10781888d7c] (GCC)

$ cat mutant.c
__builtin_acc_on_device(dev) { return __builtin_acc_on_device(dev); }

$ gcc-trunk -O2 mutant.c
mutant.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    1 | __builtin_acc_on_device(dev) { return __builtin_acc_on_device(dev); }
      | ^~~~~~~~~~~~~~~~~~~~~~~
mutant.c: In function ‘__builtin_acc_on_device’:
mutant.c:1:1: warning: type of ‘dev’ defaults to ‘int’ [-Wimplicit-int]
during IPA pass: inline
In function ‘__builtin_acc_on_device’:
cc1: internal compiler error: Segmentation fault
0xf091b3 crash_signal
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/toplev.c:327
0xa826d0 cgraph_update_edges_for_call_stmt(gimple*, tree_node*, gimple*)
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/cgraph.c:1729
0xf8bdcd fold_marked_statements
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/tree-inline.c:5384
0xf9bf87 tree_function_versioning(tree_node*, tree_node*, vec<ipa_replace_map*,
va_gc, vl_embed>*, ipa_param_adjustments*, bool, bitmap_head*,
basic_block_def*)
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/tree-inline.c:6457
0xcc1f1b save_inline_function_body
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/ipa-inline-transform.c:658
0xcc1f1b inline_transform(cgraph_node*)
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/ipa-inline-transform.c:750
0xe1c8f4 execute_one_ipa_transform_pass
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/passes.c:2290
0xe1c8f4 execute_all_ipa_transforms(bool)
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/passes.c:2337
0xa89639 cgraph_node::expand()
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/cgraphunit.c:1821
0xa8aa5f expand_all_functions
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/cgraphunit.c:1992
0xa8aa5f symbol_table::compile()
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/cgraphunit.c:2356
0xa8d95b symbol_table::compile()
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/cgraphunit.c:2269
0xa8d95b symbol_table::finalize_compilation_unit()
        /tmp/tmp.I0nMxdxnJz-gcc-builder/gcc/gcc/cgraphunit.c:2537
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

* [Bug c/100993] ICE with -O2: Segmentation fault, cgraph_update_edges_for_call_stmt(gimple*, tree_node*, gimple*)
  2021-06-09 14:25 [Bug c/100993] New: ICE with -O2: Segmentation fault, cgraph_update_edges_for_call_stmt(gimple*, tree_node*, gimple*) cnsun at uwaterloo dot ca
@ 2021-06-10  6:42 ` rguenth at gcc dot gnu.org
  2021-06-10  7:23 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-10  6:42 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jsm28 at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
            Version|tree-ssa                    |12.0
           Keywords|                            |accepts-invalid,
                   |                            |ice-on-invalid-code

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I suppose we should reject definitions in the __builtin_* namespace?  Joseph,
can we?  It's fine to define 'memcpy', but it should not valid to define (or
even declare?) __builtin_memcpy.

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

* [Bug c/100993] ICE with -O2: Segmentation fault, cgraph_update_edges_for_call_stmt(gimple*, tree_node*, gimple*)
  2021-06-09 14:25 [Bug c/100993] New: ICE with -O2: Segmentation fault, cgraph_update_edges_for_call_stmt(gimple*, tree_node*, gimple*) cnsun at uwaterloo dot ca
  2021-06-10  6:42 ` [Bug c/100993] " rguenth at gcc dot gnu.org
@ 2021-06-10  7:23 ` jakub at gcc dot gnu.org
  2021-06-10 19:16 ` joseph at codesourcery dot com
  2024-03-23 22:36 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-10  7:23 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think at least in the past glibc used to add attributes to builtins through
typeof (__builtin_whatever) __builtin_whatever __attribute__((...));
so not sure if we can completely forbid it, but we certainly should forbid when
 it has incompatible type or what one defines the body for it.

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

* [Bug c/100993] ICE with -O2: Segmentation fault, cgraph_update_edges_for_call_stmt(gimple*, tree_node*, gimple*)
  2021-06-09 14:25 [Bug c/100993] New: ICE with -O2: Segmentation fault, cgraph_update_edges_for_call_stmt(gimple*, tree_node*, gimple*) cnsun at uwaterloo dot ca
  2021-06-10  6:42 ` [Bug c/100993] " rguenth at gcc dot gnu.org
  2021-06-10  7:23 ` jakub at gcc dot gnu.org
@ 2021-06-10 19:16 ` joseph at codesourcery dot com
  2024-03-23 22:36 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: joseph at codesourcery dot com @ 2021-06-10 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
Rejecting __builtin_* declarations was previously discussed in bug 32455.  
If we do, it would probably be worth testing building various software 
with the patched GCC to see what issues arise.

For many purposes, __sync_* and __atomic_* are built-in function 
namespaces just like __builtin_* (see builtins.c:is_builtin_name).  
However, functions with such names are definitely defined in libgcc and 
libatomic, and quite possibly might be defined elsewhere.

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

* [Bug c/100993] ICE with -O2: Segmentation fault, cgraph_update_edges_for_call_stmt(gimple*, tree_node*, gimple*)
  2021-06-09 14:25 [Bug c/100993] New: ICE with -O2: Segmentation fault, cgraph_update_edges_for_call_stmt(gimple*, tree_node*, gimple*) cnsun at uwaterloo dot ca
                   ` (2 preceding siblings ...)
  2021-06-10 19:16 ` joseph at codesourcery dot com
@ 2024-03-23 22:36 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-23 22:36 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-03-23
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note a better testcase now is:
```
int __builtin_acc_on_device(int dev) { return __builtin_acc_on_device(dev); }

```

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

end of thread, other threads:[~2024-03-23 22:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 14:25 [Bug c/100993] New: ICE with -O2: Segmentation fault, cgraph_update_edges_for_call_stmt(gimple*, tree_node*, gimple*) cnsun at uwaterloo dot ca
2021-06-10  6:42 ` [Bug c/100993] " rguenth at gcc dot gnu.org
2021-06-10  7:23 ` jakub at gcc dot gnu.org
2021-06-10 19:16 ` joseph at codesourcery dot com
2024-03-23 22:36 ` pinskia 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).